OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 import "package:expect/expect.dart"; | |
6 | |
7 class S<T> { | 5 class S<T> { |
8 bool matches(o) { | 6 bool matches(o) { |
9 bool isChecked = checkUsingIs(o); | 7 bool isChecked = checkUsingIs(o); |
10 if (checkedMode) { | 8 if (checkedMode) { |
11 Expect.equals(isChecked, checkUsingCheckedMode(o)); | 9 Expect.equals(isChecked, checkUsingCheckedMode(o)); |
12 } | 10 } |
13 return isChecked; | 11 return isChecked; |
14 } | 12 } |
15 | 13 |
16 bool checkUsingIs(o) { | 14 bool checkUsingIs(o) { |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 Expect.isFalse(c2_String.matches("hello")); | 117 Expect.isFalse(c2_String.matches("hello")); |
120 | 118 |
121 var c3 = new C3(); | 119 var c3 = new C3(); |
122 Expect.isTrue(c3 is S); | 120 Expect.isTrue(c3 is S); |
123 Expect.isFalse(c3 is S<int>); | 121 Expect.isFalse(c3 is S<int>); |
124 Expect.isTrue(c3 is S<String>); | 122 Expect.isTrue(c3 is S<String>); |
125 Expect.isFalse(c3.matches(c2)); | 123 Expect.isFalse(c3.matches(c2)); |
126 Expect.isFalse(c3.matches(42)); | 124 Expect.isFalse(c3.matches(42)); |
127 Expect.isTrue(c3.matches("hello")); | 125 Expect.isTrue(c3.matches("hello")); |
128 } | 126 } |
OLD | NEW |