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

Side by Side Diff: test/minified_test.dart

Issue 919983003: Get rid of minified tests. (Closed) Base URL: git@github.com:dart-lang/matcher@master
Patch Set: Created 5 years, 10 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 | « test/iterable_matchers_test.dart ('k') | test/pretty_print_minified_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
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
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.
4
5 // This file is for matcher tests that rely on the names of various Dart types.
6 // These tests will fail when run in minified dart2js, since the names will be
7 // mangled. A version of this file that works in minified dart2js is in
8 // matchers_minified_test.dart.
9
10 import 'package:matcher/matcher.dart';
11 import 'package:unittest/unittest.dart';
12
13 import 'test_utils.dart';
14
15 // A regexp fragment matching a minified name.
16 const _MINIFIED_NAME = r"[A-Za-z0-9]{1,3}";
17
18 void main() {
19 group('Iterable Matchers', () {
20 test('isEmpty', () {
21 var d = new SimpleIterable(0);
22 var e = new SimpleIterable(1);
23 shouldPass(d, isEmpty);
24 shouldFail(e, isEmpty,
25 matches(r"Expected: empty +Actual: " + _MINIFIED_NAME + r":\[1\]"));
26 });
27
28 test('isNotEmpty', () {
29 var d = new SimpleIterable(0);
30 var e = new SimpleIterable(1);
31 shouldPass(e, isNotEmpty);
32 shouldFail(d, isNotEmpty, matches(
33 r"Expected: non-empty +Actual: " + _MINIFIED_NAME + r":\[\]"));
34 });
35
36 test('contains', () {
37 var d = new SimpleIterable(3);
38 shouldPass(d, contains(2));
39 shouldFail(d, contains(5), matches(r"Expected: contains <5> +"
40 r"Actual: " + _MINIFIED_NAME + r":\[3, 2, 1\]"));
41 });
42 });
43
44 group('Feature Matchers', () {
45 test("Feature Matcher", () {
46 var w = new Widget();
47 w.price = 10;
48 shouldPass(w, new HasPrice(10));
49 shouldPass(w, new HasPrice(greaterThan(0)));
50 shouldFail(w, new HasPrice(greaterThan(10)), matches(
51 r"Expected: Widget with a price that is a value greater than "
52 r"<10> +"
53 r"Actual: <Instance of '" + _MINIFIED_NAME + r"'> +"
54 r"Which: has price with value <10> which is not "
55 r"a value greater than <10>"));
56 });
57 });
58 }
OLDNEW
« no previous file with comments | « test/iterable_matchers_test.dart ('k') | test/pretty_print_minified_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698