Don't rely on directory traversal order in test.
R=tjblasi@google.com
Review URL: https://chromiumcodereview.appspot.com//966443004
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2a87d45..4b16a46 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,4 @@
-# 0.1.5+1, 0.1.5+2
+# 0.1.5+1, 0.1.5+2, 0.1.5+3
* Fix test files to work in main Dart repo test runner.
diff --git a/pubspec.yaml b/pubspec.yaml
index 93ab425..6611764 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: dart_style
-version: 0.1.5+2
+version: 0.1.5+3
author: Dart Team <misc@dartlang.org>
description: Opinionated, automatic Dart source code formatter.
homepage: https://github.com/dart-lang/dart_style
diff --git a/test/command_line_test.dart b/test/command_line_test.dart
index 47f817a..b2cf84a 100644
--- a/test/command_line_test.dart
+++ b/test/command_line_test.dart
@@ -126,19 +126,23 @@
d.file("b.dart", unformattedSource)
]).create();
- var process = runFormatterOnDir(["--machine"]);
-
- var json = {
+ var jsonA = JSON.encode({
"path": p.join("code", "a.dart"),
"source": formattedSource,
"selection": {"offset": -1, "length": -1}
- };
+ });
- process.stdout.expect(JSON.encode(json));
+ var jsonB = JSON.encode({
+ "path": p.join("code", "b.dart"),
+ "source": formattedSource,
+ "selection": {"offset": -1, "length": -1}
+ });
- json["path"] = p.join("code", "b.dart");
- process.stdout.expect(JSON.encode(json));
+ var process = runFormatterOnDir(["--machine"]);
+ // The order isn't specified.
+ process.stdout.expect(either(jsonA, jsonB));
+ process.stdout.expect(either(jsonA, jsonB));
process.shouldExit();
});
});