aboutsummaryrefslogtreecommitdiff
path: root/test/T560-lib-error.sh
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2015-06-08 08:02:22 +0200
committerDavid Bremner <david@tethera.net>2015-06-12 07:34:50 +0200
commit32fd74b7aa9c24ec77f8c59d09f89e0535bf64cd (patch)
treeb457ce7f91011cbfafa70c908d682a7a3a87eaf3 /test/T560-lib-error.sh
parentb59ad1a9cc6ea03764b1cd3d038920581ac5a9c4 (diff)
lib: reject relative paths in n_d_{create,open}_verbose
There are many places in the notmuch code where the path is assumed to be absolute. If someone (TM) wants a project, one could remove these assumptions. In the mean time, prevent users from shooting themselves in the foot. Update test suite mark tests for this error as no longer broken, and also convert some tests that used relative paths for nonexistent directories.
Diffstat (limited to 'test/T560-lib-error.sh')
-rwxr-xr-xtest/T560-lib-error.sh10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh
index 9f5f7aef..b1e77aa0 100755
--- a/test/T560-lib-error.sh
+++ b/test/T560-lib-error.sh
@@ -36,7 +36,6 @@ EOF
test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest "Open relative path"
-test_subtest_known_broken
test_C <<'EOF'
#include <stdio.h>
#include <notmuch.h>
@@ -55,7 +54,6 @@ EOF
test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest "Create database in relative path"
-test_subtest_known_broken
test_C <<'EOF'
#include <stdio.h>
#include <notmuch.h>
@@ -108,21 +106,21 @@ Error: Cannot create a database for a NULL path.
EOF
test_expect_equal_file EXPECTED OUTPUT
-test_begin_subtest "Create database in non-existant directory"
-test_C <<'EOF'
+test_begin_subtest "Create database in nonexistent directory"
+test_C ${PWD}/nonexistent/foo<<'EOF'
#include <stdio.h>
#include <notmuch.h>
int main (int argc, char** argv)
{
notmuch_database_t *db;
notmuch_status_t stat;
- stat = notmuch_database_create ("./nonexistent/foo", &db);
+ stat = notmuch_database_create (argv[1], &db);
}
EOF
cat <<'EOF' >EXPECTED
== stdout ==
== stderr ==
-Error: Cannot create database at ./nonexistent/foo: No such file or directory.
+Error: Cannot create database at CWD/nonexistent/foo: No such file or directory.
EOF
test_expect_equal_file EXPECTED OUTPUT