From 8ff220578c6cd0e8a1d963ce5789ca4766e13d7d Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Fri, 10 Aug 2018 02:21:22 +0200 Subject: [PATCH] add test case and update readme --- README.md | 6 ++++++ tests/run_tests.sh | 1 + tests/tc_rm_import/expected1.txt | 2 ++ tests/tc_rm_import/expected2.txt | 0 tests/tc_rm_import/file.d | 1 + tests/tc_rm_import/run.sh | 11 +++++++++++ 6 files changed, 21 insertions(+) create mode 100644 tests/tc_rm_import/expected1.txt create mode 100644 tests/tc_rm_import/expected2.txt create mode 100644 tests/tc_rm_import/file.d create mode 100755 tests/tc_rm_import/run.sh diff --git a/README.md b/README.md index 4f10cb9..c2adb4b 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,12 @@ this, run the client with the -I option: dcd-client -Ipath/to/imports +## Remove import search path + +Import paths can be removed from the server without restarting it. To accomplish +this, run the client with the -R option: + + dcd-client -Rpath/to/imports ## Find declaration of symbol at cursor diff --git a/tests/run_tests.sh b/tests/run_tests.sh index cf17c1c..ea1c0ca 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -4,6 +4,7 @@ GREEN="\033[32m" YELLOW="\033[33m" NORMAL="\033[0m" IMPORTS=$(pwd)/imports +export IMPORTS fail_count=0 pass_count=0 diff --git a/tests/tc_rm_import/expected1.txt b/tests/tc_rm_import/expected1.txt new file mode 100644 index 0000000..7d65484 --- /dev/null +++ b/tests/tc_rm_import/expected1.txt @@ -0,0 +1,2 @@ +identifiers +Point s diff --git a/tests/tc_rm_import/expected2.txt b/tests/tc_rm_import/expected2.txt new file mode 100644 index 0000000..e69de29 diff --git a/tests/tc_rm_import/file.d b/tests/tc_rm_import/file.d new file mode 100644 index 0000000..2646ddb --- /dev/null +++ b/tests/tc_rm_import/file.d @@ -0,0 +1 @@ +import point:; diff --git a/tests/tc_rm_import/run.sh b/tests/tc_rm_import/run.sh new file mode 100755 index 0000000..74382c6 --- /dev/null +++ b/tests/tc_rm_import/run.sh @@ -0,0 +1,11 @@ +set -e +set -u + +../../bin/dcd-client $1 file.d -c13 > actual1.txt +diff actual1.txt expected1.txt +../../bin/dcd-client $1 file.d -R$IMPORTS +../../bin/dcd-client $1 file.d -c13 > actual2.txt +diff actual2.txt expected2.txt +../../bin/dcd-client $1 -I$IMPORTS +../../bin/dcd-client $1 file.d -c13 > actual1.txt +diff actual1.txt expected1.txt