diff options
author | David Bremner <david@tethera.net> | 2015-06-08 08:02:22 +0200 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2015-06-12 07:34:50 +0200 |
commit | 32fd74b7aa9c24ec77f8c59d09f89e0535bf64cd (patch) | |
tree | b457ce7f91011cbfafa70c908d682a7a3a87eaf3 /test/T360-symbol-hiding.sh | |
parent | b59ad1a9cc6ea03764b1cd3d038920581ac5a9c4 (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/T360-symbol-hiding.sh')
-rwxr-xr-x | test/T360-symbol-hiding.sh | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/test/T360-symbol-hiding.sh b/test/T360-symbol-hiding.sh index d2b5d1f5..98e4d4dc 100755 --- a/test/T360-symbol-hiding.sh +++ b/test/T360-symbol-hiding.sh @@ -11,16 +11,17 @@ test_description='exception symbol hiding' . ./test-lib.sh -run_test(){ - result=$(LD_LIBRARY_PATH="$TEST_DIRECTORY/../lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" $TEST_DIRECTORY/symbol-test 2>&1) -} - -output="A Xapian exception occurred opening database: Couldn't stat 'fakedb/.notmuch/xapian' -caught No chert database found at path \`./nonexistent'" - -mkdir -p fakedb/.notmuch - -test_expect_success 'running test' run_test +test_begin_subtest 'running test' run_test +mkdir -p ${PWD}/fakedb/.notmuch +( LD_LIBRARY_PATH="$TEST_DIRECTORY/../lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \ + $TEST_DIRECTORY/symbol-test ${PWD}/fakedb ${PWD}/nonexistent \ + 2>&1 | sed "s,${PWD},CWD,g") > OUTPUT + +cat <<EOF > EXPECTED +A Xapian exception occurred opening database: Couldn't stat 'CWD/fakedb/.notmuch/xapian' +caught No chert database found at path \`CWD/nonexistent' +EOF +test_expect_equal_file EXPECTED OUTPUT test_begin_subtest 'checking output' test_expect_equal "$result" "$output" |