From: Peter Wang Date: Sat, 14 Apr 2012 01:41:03 +0000 (+1000) Subject: [PATCH v4 3/6] test: Add tests for 'config' command X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=a95b11f1bfbeeeead2d8af10f9de0852eebceb81;p=notmuch-archives.git [PATCH v4 3/6] test: Add tests for 'config' command --- diff --git a/54/d784d3e726d8a147182508153eb3f3b17208be b/54/d784d3e726d8a147182508153eb3f3b17208be new file mode 100644 index 000000000..4f0975564 --- /dev/null +++ b/54/d784d3e726d8a147182508153eb3f3b17208be @@ -0,0 +1,136 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 4E7D7431FC3 + for ; Fri, 13 Apr 2012 18:43:56 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 55shzhyV-yzb for ; + Fri, 13 Apr 2012 18:43:55 -0700 (PDT) +Received: from mail-pz0-f45.google.com (mail-pz0-f45.google.com + [209.85.210.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id C3612431FAE + for ; Fri, 13 Apr 2012 18:43:55 -0700 (PDT) +Received: by mail-pz0-f45.google.com with SMTP id x6so4544874dac.18 + for ; Fri, 13 Apr 2012 18:43:55 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; + bh=Oggmgo4qqG09ljw4KFddtGG8l26Xz84pyiEu4BUUehw=; + b=BeDkhREOHrf/anflHJBGo3p7GdjdFKNAlQLeXB8dv5XfVQKM3DuR4L5dwcZSRzMQIA + 7Ugi4S8aIjWzxtw5+oehjXtMZCHNDAgkd5BA6iTkoDlARhg73R/5LPn2FaGpqC6K5yLU + eqyX8GUXS+8HsEEHfGmNXZKQXK5yYvE+fIrKxaADJLEHXmscJaQ2X0vveMesdxJrsdiy + PqKY799PHr7IzvlQ35qvjAAWrcPYeiRQ0fvd0qsbVcWUYl4Y4zl9bkMVN/X5jo2G6aua + hLXvx/IMUfarP4O/anYAC7W/zHdfvgyOrL+6X2yvpaPVwIbTtLUWus3cvIu9ft/CPGnh + QGAA== +Received: by 10.68.204.228 with SMTP id lb4mr8948026pbc.37.1334367835591; + Fri, 13 Apr 2012 18:43:55 -0700 (PDT) +Received: from localhost (215.42.233.220.static.exetel.com.au. + [220.233.42.215]) + by mx.google.com with ESMTPS id oh2sm3677446pbb.45.2012.04.13.18.43.49 + (version=TLSv1/SSLv3 cipher=OTHER); + Fri, 13 Apr 2012 18:43:54 -0700 (PDT) +From: Peter Wang +To: notmuch@notmuchmail.org +Subject: [PATCH v4 3/6] test: Add tests for 'config' command +Date: Sat, 14 Apr 2012 11:41:03 +1000 +Message-Id: <1334367666-10954-4-git-send-email-novalazy@gmail.com> +X-Mailer: git-send-email 1.7.4.4 +In-Reply-To: <1334367666-10954-1-git-send-email-novalazy@gmail.com> +References: <1332282698-7951-1-git-send-email-novalazy@gmail.com> + <1334367666-10954-1-git-send-email-novalazy@gmail.com> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 14 Apr 2012 01:43:56 -0000 + +Start a new test script. +--- + test/config | 45 +++++++++++++++++++++++++++++++++++++++++++++ + test/notmuch-test | 1 + + 2 files changed, 46 insertions(+), 0 deletions(-) + create mode 100755 test/config + +diff --git a/test/config b/test/config +new file mode 100755 +index 0000000..9030154 +--- /dev/null ++++ b/test/config +@@ -0,0 +1,45 @@ ++#!/usr/bin/env bash ++ ++test_description='"notmuch config"' ++. test-lib.sh ++ ++test_begin_subtest "Get string value" ++test_expect_equal "$(notmuch config get user.name)" "Notmuch Test Suite" ++ ++test_begin_subtest "Get list value" ++test_expect_equal "$(notmuch config get new.tags)" "\ ++unread ++inbox" ++ ++test_begin_subtest "Set string value" ++notmuch config set foo.string "this is a string value" ++test_expect_equal "$(notmuch config get foo.string)" "this is a string value" ++ ++test_begin_subtest "Set string value again" ++notmuch config set foo.string "this is another string value" ++test_expect_equal "$(notmuch config get foo.string)" "this is another string value" ++ ++test_begin_subtest "Set list value" ++notmuch config set foo.list this "is a" "list value" ++test_expect_equal "$(notmuch config get foo.list)" "\ ++this ++is a ++list value" ++ ++test_begin_subtest "Set list value again" ++notmuch config set foo.list this "is another" "list value" ++test_expect_equal "$(notmuch config get foo.list)" "\ ++this ++is another ++list value" ++ ++test_begin_subtest "Remove key" ++notmuch config set foo.remove baz ++notmuch config set foo.remove ++test_expect_equal "$(notmuch config get foo.remove)" "" ++ ++test_begin_subtest "Remove non-existent key" ++notmuch config set foo.nonexistent ++test_expect_equal "$(notmuch config get foo.nonexistent)" "" ++ ++test_done +diff --git a/test/notmuch-test b/test/notmuch-test +index f03b594..e08ec72 100755 +--- a/test/notmuch-test ++++ b/test/notmuch-test +@@ -19,6 +19,7 @@ cd $(dirname "$0") + TESTS=" + basic + help-test ++ config + new + count + search +-- +1.7.4.4 +