From a5976f5b0d8f87d7d73cca0e55a1861a8d5d928d Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Thu, 30 Dec 2021 11:39:29 -0800 Subject: [PATCH] Disable certain autosuggestion tests on Cygwin Cygwin disallows backslashes in filenames, so these tests cannot possibly succeed there. Just disable them. --- src/fish_tests.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/fish_tests.cpp b/src/fish_tests.cpp index 3a6a5c2c6..97379e7c5 100644 --- a/src/fish_tests.cpp +++ b/src/fish_tests.cpp @@ -3613,7 +3613,10 @@ static void test_autosuggest_suggest_special() { if (system("mkdir -p 'test/autosuggest_test/0foobar'")) err(L"mkdir failed"); if (system("mkdir -p 'test/autosuggest_test/1foo bar'")) err(L"mkdir failed"); if (system("mkdir -p 'test/autosuggest_test/2foo bar'")) err(L"mkdir failed"); +#ifndef __CYGWIN__ + // Cygwin disallows backslashes in filenames. if (system("mkdir -p 'test/autosuggest_test/3foo\\bar'")) err(L"mkdir failed"); +#endif if (system("mkdir -p test/autosuggest_test/4foo\\'bar")) { err(L"mkdir failed"); // a path with a single quote } @@ -3654,11 +3657,13 @@ static void test_autosuggest_suggest_special() { __LINE__); perform_one_autosuggestion_cd_test(L"cd 'test/autosuggest_test/2", L"foo bar/", vars, __LINE__); +#ifndef __CYGWIN__ perform_one_autosuggestion_cd_test(L"cd test/autosuggest_test/3", L"foo\\bar/", vars, __LINE__); perform_one_autosuggestion_cd_test(L"cd \"test/autosuggest_test/3", L"foo\\bar/", vars, __LINE__); perform_one_autosuggestion_cd_test(L"cd 'test/autosuggest_test/3", L"foo\\bar/", vars, __LINE__); +#endif perform_one_autosuggestion_cd_test(L"cd test/autosuggest_test/4", L"foo'bar/", vars, __LINE__); perform_one_autosuggestion_cd_test(L"cd \"test/autosuggest_test/4", L"foo'bar/", vars, __LINE__); @@ -3687,9 +3692,11 @@ static void test_autosuggest_suggest_special() { perform_one_autosuggestion_cd_test(L"cd 2", L"foo bar/", vars, __LINE__); perform_one_autosuggestion_cd_test(L"cd \"2", L"foo bar/", vars, __LINE__); perform_one_autosuggestion_cd_test(L"cd '2", L"foo bar/", vars, __LINE__); +#ifndef __CYGWIN__ perform_one_autosuggestion_cd_test(L"cd 3", L"foo\\bar/", vars, __LINE__); perform_one_autosuggestion_cd_test(L"cd \"3", L"foo\\bar/", vars, __LINE__); perform_one_autosuggestion_cd_test(L"cd '3", L"foo\\bar/", vars, __LINE__); +#endif perform_one_autosuggestion_cd_test(L"cd 4", L"foo'bar/", vars, __LINE__); perform_one_autosuggestion_cd_test(L"cd \"4", L"foo'bar/", vars, __LINE__); perform_one_autosuggestion_cd_test(L"cd '4", L"foo'bar/", vars, __LINE__);