mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Make expansion test robust against different filesystem orders
Should make the tests pass on Linux
This commit is contained in:
parent
3a3a9f5cc1
commit
3bd6eab88f
1 changed files with 9 additions and 12 deletions
|
@ -1366,25 +1366,22 @@ static bool expand_test(const wchar_t *in, expand_flags_t flags, ...)
|
|||
expected.push_back(wcstring(arg));
|
||||
}
|
||||
va_end(va);
|
||||
|
||||
wcstring_list_t::const_iterator exp_it = expected.begin(), exp_end = expected.end();
|
||||
|
||||
std::set<wcstring> remaining(expected.begin(), expected.end());
|
||||
std::vector<completion_t>::const_iterator out_it = output.begin(), out_end = output.end();
|
||||
for (; exp_it != exp_end || out_it != out_end; ++exp_it, ++out_it)
|
||||
for (; out_it != out_end; ++out_it)
|
||||
{
|
||||
if (exp_it == exp_end || out_it == out_end)
|
||||
{
|
||||
// sizes don't match
|
||||
res = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (out_it->completion != *exp_it)
|
||||
if (! remaining.erase(out_it->completion))
|
||||
{
|
||||
res = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (! remaining.empty())
|
||||
{
|
||||
res = false;
|
||||
}
|
||||
|
||||
if (!res)
|
||||
{
|
||||
if ((arg = va_arg(va, wchar_t *)) != 0)
|
||||
|
|
Loading…
Reference in a new issue