Create a test that reproduces fish-shell/fish-shell#10703

This commit is contained in:
Kaley Main 2024-09-06 19:06:36 +10:00 committed by Johannes Altmanninger
parent f8a720da8c
commit a979b6341d

View file

@ -126,6 +126,7 @@ fn test_expand() {
// lol
// nub
// q
// zzz
// .foo
// aaa
// aaa2
@ -144,6 +145,7 @@ fn test_expand() {
std::fs::write("test/fish_expand_test/baz/xxx", []).unwrap();
std::fs::write("test/fish_expand_test/baz/yyy", []).unwrap();
std::fs::write("test/fish_expand_test/lol/nub/q", []).unwrap();
std::fs::write("test/fish_expand_test/lol/nub/zzz", []).unwrap();
std::fs::write("test/fish_expand_test/aaa2/x", []).unwrap();
// This is checking that .* does NOT match . and ..
@ -291,6 +293,13 @@ fn test_expand() {
"Wrong fuzzy matching 3"
);
expand_test!(
"test/fish_expand_test/*/nu/zz",
fuzzy_comp,
(format!("test/fish_expand_test/{any_str_str}/nub/zzz")),
"Glob did not expand correctly with more than one path item after the *"
);
expand_test!(
"test/fish_expand_test/b/yyy",
fuzzy_comp,