OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 matcher.operator_matchers_test; | 5 library matcher.operator_matchers_test; |
6 | 6 |
7 import 'package:matcher/matcher.dart'; | 7 import 'package:matcher/matcher.dart'; |
8 import 'package:unittest/unittest.dart' | 8 import 'package:test/test.dart' |
9 show test, group, expect, throwsArgumentError; | 9 show test, group, expect, throwsArgumentError; |
10 | 10 |
11 import 'test_utils.dart'; | 11 import 'test_utils.dart'; |
12 | 12 |
13 void main() { | 13 void main() { |
14 test('anyOf', () { | 14 test('anyOf', () { |
15 // with a list | 15 // with a list |
16 shouldFail( | 16 shouldFail( |
17 0, anyOf([equals(1), equals(2)]), "Expected: (<1> or <2>) Actual: <0>"); | 17 0, anyOf([equals(1), equals(2)]), "Expected: (<1> or <2>) Actual: <0>"); |
18 shouldPass(1, anyOf([equals(1), equals(2)])); | 18 shouldPass(1, anyOf([equals(1), equals(2)])); |
(...skipping 30 matching lines...) Expand all Loading... |
49 "Actual: <4> " | 49 "Actual: <4> " |
50 "Which: is not a value less than <4>"); | 50 "Which: is not a value less than <4>"); |
51 }); | 51 }); |
52 | 52 |
53 test('If the first argument is a List, the rest must be null', () { | 53 test('If the first argument is a List, the rest must be null', () { |
54 expect(() => allOf([], 5), throwsArgumentError); | 54 expect(() => allOf([], 5), throwsArgumentError); |
55 expect( | 55 expect( |
56 () => anyOf([], null, null, null, null, null, 42), throwsArgumentError); | 56 () => anyOf([], null, null, null, null, null, 42), throwsArgumentError); |
57 }); | 57 }); |
58 } | 58 } |
OLD | NEW |