From c92e4f35fd4e9ebdca5d0742fe45f779e4c879b1 Mon Sep 17 00:00:00 2001 From: Sam McCall Date: Tue, 9 Oct 2018 10:02:02 +0000 Subject: [PATCH] [clangd] Fix nondeterministic test llvm-svn: 344030 --- clang-tools-extra/unittests/clangd/DexTests.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clang-tools-extra/unittests/clangd/DexTests.cpp b/clang-tools-extra/unittests/clangd/DexTests.cpp index 66951f5908da..130659247805 100644 --- a/clang-tools-extra/unittests/clangd/DexTests.cpp +++ b/clang-tools-extra/unittests/clangd/DexTests.cpp @@ -23,6 +23,7 @@ #include #include +using ::testing::AnyOf; using ::testing::ElementsAre; using ::testing::UnorderedElementsAre; using namespace llvm; @@ -257,7 +258,9 @@ TEST(DexIterators, StringRepresentation) { EXPECT_EQ(llvm::to_string(*I2), "T=L2"); auto Tree = C.limit(C.intersect(move(I1), move(I2)), 10); - EXPECT_EQ(llvm::to_string(*Tree), "(LIMIT 10 (& [1 3 5] T=L2))"); + // AND reorders its children, we don't care which order it prints. + EXPECT_THAT(llvm::to_string(*Tree), AnyOf("(LIMIT 10 (& [1 3 5] T=L2))", + "(LIMIT 10 (& T=L2 [1 3 5]))")); } TEST(DexIterators, Limit) {