aboutsummaryrefslogtreecommitdiffhomepage
path: root/fish_tests.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-10-11 16:50:16 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-10-11 16:50:16 -0700
commitfbade198b942a666d3fc1110804a7da2c47918f1 (patch)
tree6f56426f78f34b15b937c862c54fac5b2091ba2a /fish_tests.cpp
parentd982f2a5752428b437c204a777aa1830bd50ee77 (diff)
Support space separators for abbreviations as part of #731
Diffstat (limited to 'fish_tests.cpp')
-rw-r--r--fish_tests.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/fish_tests.cpp b/fish_tests.cpp
index c46dcf7a..34d505c9 100644
--- a/fish_tests.cpp
+++ b/fish_tests.cpp
@@ -1466,7 +1466,8 @@ static void test_abbreviations(void)
L"=" ARRAY_SEP_STR
L"=foo" ARRAY_SEP_STR
L"foo" ARRAY_SEP_STR
- L"foo=bar";
+ L"foo=bar" ARRAY_SEP_STR
+ L"gx git checkout";
env_push(true);
@@ -1493,6 +1494,11 @@ static void test_abbreviations(void)
expanded = reader_expand_abbreviation_in_command(L"gc somebranch", wcslen(L"gc"), &result);
if (! expanded) err(L"gc not expanded");
if (result != L"git checkout somebranch") err(L"gc incorrectly expanded on line %ld to '%ls'", (long)__LINE__, result.c_str());
+
+ /* space separation */
+ expanded = reader_expand_abbreviation_in_command(L"gx somebranch", wcslen(L"gc"), &result);
+ if (! expanded) err(L"gx not expanded");
+ if (result != L"git checkout somebranch") err(L"gc incorrectly expanded on line %ld to '%ls'", (long)__LINE__, result.c_str());
expanded = reader_expand_abbreviation_in_command(L"echo hi ; gc somebranch", wcslen(L"echo hi ; g"), &result);
if (! expanded) err(L"gc not expanded on line %ld", (long)__LINE__);