Skip to content

Commit

Permalink
Get rid of minified tests.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nex3 committed Feb 19, 2015
1 parent 9f15e52 commit 3c8ee69
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 248 deletions.
12 changes: 0 additions & 12 deletions .status
Expand Up @@ -13,15 +13,3 @@ packages/*: Skip
# 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
12 changes: 12 additions & 0 deletions test/core_matchers_test.dart
Expand Up @@ -187,4 +187,16 @@ void main() {
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>");
});
}
23 changes: 23 additions & 0 deletions test/iterable_matchers_test.dart
Expand Up @@ -161,4 +161,27 @@ void main() {
"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]");
});
}
58 changes: 0 additions & 58 deletions test/minified_test.dart

This file was deleted.

64 changes: 0 additions & 64 deletions test/pretty_print_minified_test.dart

This file was deleted.

43 changes: 43 additions & 0 deletions test/pretty_print_test.dart
Expand Up @@ -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>'));
Expand Down Expand Up @@ -191,4 +207,31 @@ void main() {
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]"));
});
});
}
60 changes: 0 additions & 60 deletions test/pretty_print_unminified_test.dart

This file was deleted.

54 changes: 0 additions & 54 deletions test/unminified_test.dart

This file was deleted.

0 comments on commit 3c8ee69

Please sign in to comment.