Get rid of minified tests.
We aren't running the tests against minified dart2js, and we don't
particularly want to.
R=kevmoo@google.com
Review URL: https://codereview.chromium.org//919983003
diff --git a/.status b/.status
index 63937ba..ff095a2 100644
--- a/.status
+++ b/.status
@@ -13,15 +13,3 @@
# Only run tests from the build directory, since we don't care about the
# difference between transformed an untransformed code.
test/*: Skip
-
-[ $compiler == dart2js && $minified ]
-# The unminified matcher tests test that the real names of Dart types are
-# printed. Minified versions of these tests exist that test the behavior when
-# minified.
-build/test/unminified_test: Skip # DO NOT COPY THIS UNLESS YOU WORK ON DART2JS
-
-[ $minified == false ]
-# The minified matcher tests test that the minified names of Dart types are
-# printed. Unminified versions of these tests exist that test the behavior when
-# not minified.
-build/test/minified_test: Skip # DO NOT COPY THIS UNLESS YOU WORK ON DART2JS
diff --git a/test/core_matchers_test.dart b/test/core_matchers_test.dart
index 3213455..5d8a194 100644
--- a/test/core_matchers_test.dart
+++ b/test/core_matchers_test.dart
@@ -187,4 +187,16 @@
shouldPass('cow', predicate((x) => x is String, "an instance of String"));
});
});
+
+ test("Feature Matcher", () {
+ var w = new Widget();
+ w.price = 10;
+ shouldPass(w, new HasPrice(10));
+ shouldPass(w, new HasPrice(greaterThan(0)));
+ shouldFail(w, new HasPrice(greaterThan(10)),
+ "Expected: Widget with a price that is a value greater than <10> "
+ "Actual: <Instance of 'Widget'> "
+ "Which: has price with value <10> which is not "
+ "a value greater than <10>");
+ });
}
diff --git a/test/iterable_matchers_test.dart b/test/iterable_matchers_test.dart
index ed15da7..e92fff0 100644
--- a/test/iterable_matchers_test.dart
+++ b/test/iterable_matchers_test.dart
@@ -161,4 +161,27 @@
"Actual: [1, 2, 3] "
"Which: has <1> which is not double <1> at index 0");
});
+
+ test('isEmpty', () {
+ var d = new SimpleIterable(0);
+ var e = new SimpleIterable(1);
+ shouldPass(d, isEmpty);
+ shouldFail(e, isEmpty, "Expected: empty "
+ "Actual: SimpleIterable:[1]");
+ });
+
+ test('isNotEmpty', () {
+ var d = new SimpleIterable(0);
+ var e = new SimpleIterable(1);
+ shouldPass(e, isNotEmpty);
+ shouldFail(d, isNotEmpty, "Expected: non-empty "
+ "Actual: SimpleIterable:[]");
+ });
+
+ test('contains', () {
+ var d = new SimpleIterable(3);
+ shouldPass(d, contains(2));
+ shouldFail(d, contains(5), "Expected: contains <5> "
+ "Actual: SimpleIterable:[3, 2, 1]");
+ });
}
diff --git a/test/minified_test.dart b/test/minified_test.dart
deleted file mode 100644
index 34c5cf0..0000000
--- a/test/minified_test.dart
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// This file is for matcher tests that rely on the names of various Dart types.
-// These tests will fail when run in minified dart2js, since the names will be
-// mangled. A version of this file that works in minified dart2js is in
-// matchers_minified_test.dart.
-
-import 'package:matcher/matcher.dart';
-import 'package:unittest/unittest.dart';
-
-import 'test_utils.dart';
-
-// A regexp fragment matching a minified name.
-const _MINIFIED_NAME = r"[A-Za-z0-9]{1,3}";
-
-void main() {
- group('Iterable Matchers', () {
- test('isEmpty', () {
- var d = new SimpleIterable(0);
- var e = new SimpleIterable(1);
- shouldPass(d, isEmpty);
- shouldFail(e, isEmpty,
- matches(r"Expected: empty +Actual: " + _MINIFIED_NAME + r":\[1\]"));
- });
-
- test('isNotEmpty', () {
- var d = new SimpleIterable(0);
- var e = new SimpleIterable(1);
- shouldPass(e, isNotEmpty);
- shouldFail(d, isNotEmpty, matches(
- r"Expected: non-empty +Actual: " + _MINIFIED_NAME + r":\[\]"));
- });
-
- test('contains', () {
- var d = new SimpleIterable(3);
- shouldPass(d, contains(2));
- shouldFail(d, contains(5), matches(r"Expected: contains <5> +"
- r"Actual: " + _MINIFIED_NAME + r":\[3, 2, 1\]"));
- });
- });
-
- group('Feature Matchers', () {
- test("Feature Matcher", () {
- var w = new Widget();
- w.price = 10;
- shouldPass(w, new HasPrice(10));
- shouldPass(w, new HasPrice(greaterThan(0)));
- shouldFail(w, new HasPrice(greaterThan(10)), matches(
- r"Expected: Widget with a price that is a value greater than "
- r"<10> +"
- r"Actual: <Instance of '" + _MINIFIED_NAME + r"'> +"
- r"Which: has price with value <10> which is not "
- r"a value greater than <10>"));
- });
- });
-}
diff --git a/test/pretty_print_minified_test.dart b/test/pretty_print_minified_test.dart
deleted file mode 100644
index 9eb6d76..0000000
--- a/test/pretty_print_minified_test.dart
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// This file is for pretty-print tests that rely on the names of various Dart
-// types. These tests normally fail when run in minified dart2js, since the
-// names will be mangled. This version of the file is modified to expect
-// minified names.
-
-library matcher.print_minified_test;
-
-import 'dart:collection';
-
-import 'package:matcher/matcher.dart';
-import 'package:matcher/src/pretty_print.dart';
-import 'package:unittest/unittest.dart' show test, group, expect;
-
-class DefaultToString {}
-
-class CustomToString {
- String toString() => "string representation";
-}
-
-class _PrivateName {
- String toString() => "string representation";
-}
-
-class _PrivateNameIterable extends IterableMixin {
- Iterator get iterator => [1, 2, 3].iterator;
-}
-
-// A regexp fragment matching a minified name.
-final _minifiedName = r"[A-Za-z0-9]{1,3}";
-
-void main() {
- group('with an object', () {
- test('with a default [toString]', () {
- expect(prettyPrint(new DefaultToString()),
- matches(r"<Instance of '" + _minifiedName + r"'>"));
- });
-
- test('with a custom [toString]', () {
- expect(prettyPrint(new CustomToString()),
- matches(_minifiedName + r':<string representation>'));
- });
-
- test('with a custom [toString] and a private name', () {
- expect(prettyPrint(new _PrivateName()),
- matches(_minifiedName + r':<string representation>'));
- });
- });
-
- group('with an iterable', () {
- test("that's not a list", () {
- expect(prettyPrint([1, 2, 3, 4].map((n) => n * 2)),
- matches(_minifiedName + r":\[2, 4, 6, 8\]"));
- });
-
- test("that's not a list and has a private name", () {
- expect(prettyPrint(new _PrivateNameIterable()),
- matches(_minifiedName + r":\[1, 2, 3\]"));
- });
- });
-}
diff --git a/test/pretty_print_test.dart b/test/pretty_print_test.dart
index 1e3704f..c1e0a59 100644
--- a/test/pretty_print_test.dart
+++ b/test/pretty_print_test.dart
@@ -4,10 +4,26 @@
library matcher.pretty_print_test;
+import 'dart:collection';
+
import 'package:matcher/matcher.dart';
import 'package:matcher/src/pretty_print.dart';
import 'package:unittest/unittest.dart' show group, test, expect;
+class DefaultToString {}
+
+class CustomToString {
+ String toString() => "string representation";
+}
+
+class _PrivateName {
+ String toString() => "string representation";
+}
+
+class _PrivateNameIterable extends IterableMixin {
+ Iterator get iterator => [1, 2, 3].iterator;
+}
+
void main() {
test('with primitive objects', () {
expect(prettyPrint(12), equals('<12>'));
@@ -191,4 +207,31 @@
equals("{'0': 1, '2': 3, ...}"));
});
});
+ group('with an object', () {
+ test('with a default [toString]', () {
+ expect(prettyPrint(new DefaultToString()),
+ equals("<Instance of 'DefaultToString'>"));
+ });
+
+ test('with a custom [toString]', () {
+ expect(prettyPrint(new CustomToString()),
+ equals('CustomToString:<string representation>'));
+ });
+
+ test('with a custom [toString] and a private name', () {
+ expect(
+ prettyPrint(new _PrivateName()), equals('?:<string representation>'));
+ });
+ });
+
+ group('with an iterable', () {
+ test("that's not a list", () {
+ expect(prettyPrint([1, 2, 3, 4].map((n) => n * 2)),
+ equals("MappedListIterable:[2, 4, 6, 8]"));
+ });
+
+ test("that's not a list and has a private name", () {
+ expect(prettyPrint(new _PrivateNameIterable()), equals("?:[1, 2, 3]"));
+ });
+ });
}
diff --git a/test/pretty_print_unminified_test.dart b/test/pretty_print_unminified_test.dart
deleted file mode 100644
index f14dfb8..0000000
--- a/test/pretty_print_unminified_test.dart
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// This file is for pretty-print tests that rely on the names of various Dart
-// types. These tests will fail when run in minified dart2js, since the names
-// will be mangled. A version of this file that works in minified dart2js is in
-// pretty_print_minified_test.dart.
-
-library matcher.print_unminified_test;
-
-import 'dart:collection';
-
-import 'package:matcher/matcher.dart';
-import 'package:matcher/src/pretty_print.dart';
-import 'package:unittest/unittest.dart' show test, group, expect;
-
-class DefaultToString {}
-
-class CustomToString {
- String toString() => "string representation";
-}
-
-class _PrivateName {
- String toString() => "string representation";
-}
-
-class _PrivateNameIterable extends IterableMixin {
- Iterator get iterator => [1, 2, 3].iterator;
-}
-
-void main() {
- group('with an object', () {
- test('with a default [toString]', () {
- expect(prettyPrint(new DefaultToString()),
- equals("<Instance of 'DefaultToString'>"));
- });
-
- test('with a custom [toString]', () {
- expect(prettyPrint(new CustomToString()),
- equals('CustomToString:<string representation>'));
- });
-
- test('with a custom [toString] and a private name', () {
- expect(
- prettyPrint(new _PrivateName()), equals('?:<string representation>'));
- });
- });
-
- group('with an iterable', () {
- test("that's not a list", () {
- expect(prettyPrint([1, 2, 3, 4].map((n) => n * 2)),
- equals("MappedListIterable:[2, 4, 6, 8]"));
- });
-
- test("that's not a list and has a private name", () {
- expect(prettyPrint(new _PrivateNameIterable()), equals("?:[1, 2, 3]"));
- });
- });
-}
diff --git a/test/unminified_test.dart b/test/unminified_test.dart
deleted file mode 100644
index 615c7e8..0000000
--- a/test/unminified_test.dart
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// This file is for matcher tests that rely on the names of various Dart types.
-// These tests will fail when run in minified dart2js, since the names will be
-// mangled. A version of this file that works in minified dart2js is in
-// matchers_minified_test.dart.
-
-import 'package:matcher/matcher.dart';
-import 'package:unittest/unittest.dart';
-
-import 'test_utils.dart';
-
-void main() {
- group('Iterable Matchers', () {
- test('isEmpty', () {
- var d = new SimpleIterable(0);
- var e = new SimpleIterable(1);
- shouldPass(d, isEmpty);
- shouldFail(e, isEmpty, "Expected: empty "
- "Actual: SimpleIterable:[1]");
- });
-
- test('isNotEmpty', () {
- var d = new SimpleIterable(0);
- var e = new SimpleIterable(1);
- shouldPass(e, isNotEmpty);
- shouldFail(d, isNotEmpty, "Expected: non-empty "
- "Actual: SimpleIterable:[]");
- });
-
- test('contains', () {
- var d = new SimpleIterable(3);
- shouldPass(d, contains(2));
- shouldFail(d, contains(5), "Expected: contains <5> "
- "Actual: SimpleIterable:[3, 2, 1]");
- });
- });
-
- group('Feature Matchers', () {
- test("Feature Matcher", () {
- var w = new Widget();
- w.price = 10;
- shouldPass(w, new HasPrice(10));
- shouldPass(w, new HasPrice(greaterThan(0)));
- shouldFail(w, new HasPrice(greaterThan(10)),
- "Expected: Widget with a price that is a value greater than <10> "
- "Actual: <Instance of 'Widget'> "
- "Which: has price with value <10> which is not "
- "a value greater than <10>");
- });
- });
-}