aboutsummaryrefslogtreecommitdiffhomepage
path: root/fish_tests.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-09-30 11:14:57 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-09-30 11:15:22 -0700
commitc181de1d7fa46821c7a89633e3ab3639d89fd2a3 (patch)
treec1bad468475989f22f827bee016d38c35046e4ed /fish_tests.cpp
parentd67800bbce8731cec7ab38609af3e2fe713e16c3 (diff)
Teach the highlighter about multiple adjacent square bracket expansions
Fixes #1627
Diffstat (limited to 'fish_tests.cpp')
-rw-r--r--fish_tests.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/fish_tests.cpp b/fish_tests.cpp
index 0ec8bf7b..c46dcf7a 100644
--- a/fish_tests.cpp
+++ b/fish_tests.cpp
@@ -3620,8 +3620,19 @@ static void test_highlighting(void)
{NULL, -1}
};
+ const highlight_component_t components13[] =
+ {
+ {L"echo", highlight_spec_command},
+ {L"$$foo[", highlight_spec_operator},
+ {L"1", highlight_spec_param},
+ {L"][", highlight_spec_operator},
+ {L"2", highlight_spec_param},
+ {L"]", highlight_spec_operator},
+ {L"[3]", highlight_spec_param}, // two dollar signs, so last one is not an expansion
+ {NULL, -1}
+ };
- const highlight_component_t *tests[] = {components1, components2, components3, components4, components5, components6, components7, components8, components9, components10, components11, components12};
+ const highlight_component_t *tests[] = {components1, components2, components3, components4, components5, components6, components7, components8, components9, components10, components11, components12, components13};
for (size_t which = 0; which < sizeof tests / sizeof *tests; which++)
{
const highlight_component_t *components = tests[which];