Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(911)

Side by Side Diff: packages/path/test/utils.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « packages/path/test/url_test.dart ('k') | packages/path/test/windows_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library path.test.utils;
6
7 import "package:test/test.dart"; 5 import "package:test/test.dart";
8 import "package:path/path.dart" as path; 6 import "package:path/path.dart" as p;
9 7
10 /// A matcher for a closure that throws a [path.PathException]. 8 /// A matcher for a closure that throws a [path.PathException].
11 final throwsPathException = throwsA(new isInstanceOf<path.PathException>()); 9 final throwsPathException = throwsA(new isInstanceOf<p.PathException>());
10
11 void expectEquals(p.Context context, String path1, String path2) {
12 expect(context.equals(path1, path2), isTrue,
13 reason: 'Expected "$path1" to equal "$path2".');
14 expect(context.equals(path2, path1), isTrue,
15 reason: 'Expected "$path2" to equal "$path1".');
16 expect(context.hash(path1), equals(context.hash(path2)),
17 reason: 'Expected "$path1" to hash the same as "$path2".');
18 }
19
20 void expectNotEquals(p.Context context, String path1, String path2,
21 {bool allowSameHash: false}) {
22 expect(context.equals(path1, path2), isFalse,
23 reason: 'Expected "$path1" not to equal "$path2".');
24 expect(context.equals(path2, path1), isFalse,
25 reason: 'Expected "$path2" not to equal "$path1".');
26
27 // Hash collisions are allowed, but the test author should be explicitly aware
28 // when they occur.
29 if (allowSameHash) return;
30 expect(context.hash(path1), isNot(equals(context.hash(path2))),
31 reason: 'Expected "$path1" not to hash the same as "$path2".');
32 }
OLDNEW
« no previous file with comments | « packages/path/test/url_test.dart ('k') | packages/path/test/windows_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698