From patchwork Thu Apr 9 13:48:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yousong Zhou X-Patchwork-Id: 459739 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A358B1402DE for ; Thu, 9 Apr 2015 23:58:49 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=d1kUmJ4d; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 6E8EF28BEE2; Thu, 9 Apr 2015 15:57:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id BA9DF28BCE9 for ; Thu, 9 Apr 2015 15:56:52 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .gmail. - helo: .mail-pd0-f173.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -8.5 Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 9 Apr 2015 15:56:51 +0200 (CEST) Received: by pddn5 with SMTP id n5so153887337pdd.2 for ; Thu, 09 Apr 2015 06:57:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:from:to:cc:subject:date:in-reply-to:references; bh=OYlkPbcrOYjeKRf7EbHqUF9xnK1tzY+QNc1555o71AI=; b=d1kUmJ4d94jt0mJJbmTO6OzT3yUBcjOUoNiobpcvZJioUzL4oofoEHrAAxDh8vieF9 B7ljLdmXG04Xb9kqPoPEpSOwbmS9MjNZapM965RGcfQ3H2AX/nHukv9zbVCTZ+5BdW/w P0wp8IH+uqukNK/45BQKX9wqbNzTdVOL9n7vGTUFflEuF8KRDYnF8IyUIUihCbr7pcPn lo8/qPu2gx+QDuOaP17o0yq2LtKQzKg+WMeTbJFX9EsaOmNqia6huQYEnBkjFhQRco3g 53XVuzh3GNaZXcB9LShm7Xy93enoDTeysmYDUfI8xYLBEA/MHrP/axgywc5Id8EEUram eUlg== X-Received: by 10.70.133.170 with SMTP id pd10mr14229734pdb.127.1428587857129; Thu, 09 Apr 2015 06:57:37 -0700 (PDT) Received: from debian.corp.sankuai.com ([103.29.140.56]) by mx.google.com with ESMTPSA id cr1sm14711120pdb.7.2015.04.09.06.57.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Apr 2015 06:57:36 -0700 (PDT) Message-ID: <55268550.215d460a.292a.ffff8406@mx.google.com> X-Google-Original-Message-ID: <1428587327-30017-2-git-send-email-y> From: yszhou4tech@gmail.com X-Google-Original-From: y To: nbd@openwrt.org Date: Thu, 9 Apr 2015 21:48:46 +0800 X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1428587327-30017-1-git-send-email-y> References: <1428587327-30017-1-git-send-email-y> Cc: openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH 1/2] tests: add test coverage for comment lines within batch commands. X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" From: Yousong Zhou Signed-off-by: Yousong Zhou --- test/references/batch_comments.result | 9 +++++++++ test/tests.d/060_batch | 26 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 test/references/batch_comments.result diff --git a/test/references/batch_comments.result b/test/references/batch_comments.result new file mode 100644 index 0000000..c726bad --- /dev/null +++ b/test/references/batch_comments.result @@ -0,0 +1,9 @@ + +config section 'SEC0' + option option0 'value0' + option option1 '"Hello, + World"' + +config section 'SEC1' + option option0 'value1' + diff --git a/test/tests.d/060_batch b/test/tests.d/060_batch index 49d15e4..40f473b 100644 --- a/test/tests.d/060_batch +++ b/test/tests.d/060_batch @@ -15,3 +15,29 @@ EOF assertSameFile "${REF_DIR}/batch_set.result" "${CONFIG_DIR}/batch_set" } +test_batch_comments() +{ + touch ${CONFIG_DIR}/batch_comments + + ${UCI} batch <