tools: sort the match results in the vwhere test, to make it less flaky (#22033)

This commit is contained in:
Kim Shrier 2024-08-11 16:11:21 -06:00 committed by GitHub
parent d7bdb72b48
commit 42d99ba872
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -190,6 +190,9 @@ fn test_find_in_dir_recursive() {
mut fdr := Finder{} mut fdr := Finder{}
fdr.configure_from_arguments(args) fdr.configure_from_arguments(args)
fdr.search_for_matches() fdr.search_for_matches()
// the order of matches is not guaranteed.
// sorting by line number makes the result more deterministic.
fdr.matches.sort(a.line < b.line)
dump(fdr.matches) dump(fdr.matches)
assert fdr.matches == [ assert fdr.matches == [