Chromium Code Reviews| Index: pkg/unittest/test/matchers_test.dart |
| diff --git a/pkg/unittest/test/matchers_test.dart b/pkg/unittest/test/matchers_test.dart |
| index 9f8e121944b59f8fcb564ca5808fa769121c4cbc..8678966b11227c7ffdfd660b6e70a6f95f0a55f6 100644 |
| --- a/pkg/unittest/test/matchers_test.dart |
| +++ b/pkg/unittest/test/matchers_test.dart |
| @@ -401,6 +401,15 @@ void main() { |
| "Actual: [1, 2]"); |
| }); |
| + test('equals with matcher element', () { |
| + var d = ['foo', 'bar']; |
| + shouldPass(d, equals(['foo', startsWith('ba')])); |
| + shouldFail(d, equals(['foo', endsWith('ba')]), |
| + "Expected: ['foo', <a string ending with 'ba'>] " |
| + "Actual: ['foo', 'bar'] " |
| + "Which: does not match a string ending with 'ba' at location [1]"); |
| + }); |
| + |
| test('isIn', () { |
| var d = [1, 2]; |
| shouldPass(1, isIn(d)); |
| @@ -593,6 +602,16 @@ void main() { |
| "Which: has different length and is missing map key 'foo'"); |
| }); |
| + test('equals with matcher value', () { |
| + var a = new Map(); |
| + a['foo'] = 'bar'; |
| + shouldPass(a, equals({'foo': startsWith('ba')})); |
| + shouldFail(a, equals({'foo': endsWith('ba')}), |
| + "Expected: {'foo': <a string ending with 'ba'>} " |
| + "Actual: {'foo': 'bar'} " |
| + "Which: does not match a string ending with 'ba' at location ['foo']"); |
|
Siggi Cherem (dart-lang)
2014/02/28 02:41:04
80 col
Bob Nystrom
2014/02/28 17:31:24
Done.
|
| + }); |
| + |
| test('contains', () { |
| var a = new Map(); |
| a['foo'] = 'bar'; |