diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2016-02-04 12:45:09 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2016-02-04 12:46:52 -0800 |
commit | dae0f63e5ba0a1c05f2a9b70b5e0f86bb532a4f5 (patch) | |
tree | 25d3f0901ffd894cda4da89b562a074d226f25d3 /src/fish_tests.cpp | |
parent | 0779c89a65cdcce7cf76bf97764b86b2c16fb880 (diff) |
Prefer special autosuggestions to match case
Fixes #2672
Diffstat (limited to 'src/fish_tests.cpp')
-rw-r--r-- | src/fish_tests.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/fish_tests.cpp b/src/fish_tests.cpp index 90d9dadc..f875438d 100644 --- a/src/fish_tests.cpp +++ b/src/fish_tests.cpp @@ -2302,7 +2302,7 @@ static void test_completion_insertions() static void perform_one_autosuggestion_special_test(const wcstring &command, const wcstring &wd, const wcstring &expected, long line) { wcstring suggestion; - bool success = autosuggest_suggest_special(command, wd, suggestion); + bool success = autosuggest_suggest_special(command, wd, &suggestion); if (! success) { printf("line %ld: autosuggest_suggest_special() failed for command %ls\n", line, command.c_str()); @@ -2330,8 +2330,11 @@ static void test_autosuggest_suggest_special() if (system("mkdir -p /tmp/autosuggest_test/start/unique2/unique3/multi4")) err(L"mkdir failed"); if (system("mkdir -p /tmp/autosuggest_test/start/unique2/unique3/multi42")) err(L"mkdir failed"); if (system("mkdir -p /tmp/autosuggest_test/start/unique2/.hiddenDir/moreStuff")) err(L"mkdir failed"); - + const wcstring wd = L"/tmp/autosuggest_test/"; + + env_set(L"AUTOSUGGEST_TEST_LOC", wd.c_str(), ENV_LOCAL); + perform_one_autosuggestion_special_test(L"cd /tmp/autosuggest_test/0", wd, L"cd /tmp/autosuggest_test/0foobar/", __LINE__); perform_one_autosuggestion_special_test(L"cd \"/tmp/autosuggest_test/0", wd, L"cd \"/tmp/autosuggest_test/0foobar/\"", __LINE__); perform_one_autosuggestion_special_test(L"cd '/tmp/autosuggest_test/0", wd, L"cd '/tmp/autosuggest_test/0foobar/'", __LINE__); @@ -2373,6 +2376,8 @@ static void test_autosuggest_suggest_special() perform_one_autosuggestion_special_test(L"cd 5", wd, L"cd 5foo\\\"bar/", __LINE__); perform_one_autosuggestion_special_test(L"cd \"5", wd, L"cd \"5foo\\\"bar/\"", __LINE__); perform_one_autosuggestion_special_test(L"cd '5", wd, L"cd '5foo\"bar/'", __LINE__); + + //perform_one_autosuggestion_special_test(L"cd $AUTOSUGGEST_TEST_LOC/0", wd, L"cd $AUTOSUGGEST_TEST_LOC/0foobar/", __LINE__); perform_one_autosuggestion_special_test(L"cd ~/test_autosuggest_suggest_specia", wd, L"cd ~/test_autosuggest_suggest_special/", __LINE__); |