2
0
Fork 0
mirror of https://github.com/fish-shell/fish-shell synced 2025-02-14 21:18:45 +00:00

Allow low-level tests to at least run to completion under Cygwin

They still don't pass due to path differences, but at least they run to
completion so we can tell just how broken everything is.
This commit is contained in:
Mahmoud Al-Qudsi 2021-02-22 16:27:45 -06:00
parent d769582023
commit 17926a9197

View file

@ -3142,7 +3142,9 @@ static void test_complete() {
if (system("mkdir -p 'test/complete_test'")) err(L"mkdir failed");
if (system("touch 'test/complete_test/has space'")) err(L"touch failed");
if (system("touch 'test/complete_test/bracket[abc]'")) err(L"touch failed");
#ifndef __CYGWIN__ // Square brackets are not legal path characters on WIN32/CYGWIN
if (system(R"(touch 'test/complete_test/gnarlybracket\[abc]')")) err(L"touch failed");
#endif
if (system("touch 'test/complete_test/testfile'")) err(L"touch failed");
if (system("chmod 700 'test/complete_test/testfile'")) err(L"chmod failed");
@ -3177,6 +3179,7 @@ static void test_complete() {
completions.front().completion, completions.front().flags, cmdline, &where, false);
do_test(newcmdline == L"touch test/complete_test/bracket\\[abc\\] ");
#ifndef __CYGWIN__ // Square brackets are not legal path characters on WIN32/CYGWIN
cmdline = LR"(touch test/complete_test/gnarlybracket\\[)";
completions = do_complete(cmdline, {});
do_test(completions.size() == 1);
@ -3185,6 +3188,7 @@ static void test_complete() {
newcmdline = completion_apply_to_command_line(
completions.front().completion, completions.front().flags, cmdline, &where, false);
do_test(newcmdline == LR"(touch test/complete_test/gnarlybracket\\\[abc\] )");
#endif
// Add a function and test completing it in various ways.
// Note we're depending on function_add not complaining when given missing parsed_source /