OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
7 | 7 |
8 library engine.test_support; | 8 library engine.test_support; |
9 | 9 |
10 import 'dart:collection'; | 10 import 'dart:collection'; |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 * | 314 * |
315 * @param expectedClass the class that the object is expected to be an instanc
e of | 315 * @param expectedClass the class that the object is expected to be an instanc
e of |
316 * @param object the object being tested | 316 * @param object the object being tested |
317 * @return the object that was being tested | 317 * @return the object that was being tested |
318 * @throws Exception if the object is not an instance of the expected class | 318 * @throws Exception if the object is not an instance of the expected class |
319 */ | 319 */ |
320 static Object assertInstanceOf(Predicate<Object> predicate, | 320 static Object assertInstanceOf(Predicate<Object> predicate, |
321 Type expectedClass, Object object) { | 321 Type expectedClass, Object object) { |
322 if (!predicate(object)) { | 322 if (!predicate(object)) { |
323 JUnitTestCase.fail( | 323 JUnitTestCase.fail( |
324 "Expected instance of $expectedClass, found ${(object == null ? "null"
: object.runtimeType)}"); | 324 "Expected instance of $expectedClass, found ${object == null ? "null"
: object.runtimeType}"); |
325 } | 325 } |
326 return object; | 326 return object; |
327 } | 327 } |
328 | 328 |
329 /** | 329 /** |
330 * Assert that the given array is non-`null` and has the expected number of el
ements. | 330 * Assert that the given array is non-`null` and has the expected number of el
ements. |
331 * | 331 * |
332 * @param expectedLength the expected number of elements | 332 * @param expectedLength the expected number of elements |
333 * @param array the array being tested | 333 * @param array the array being tested |
334 * @throws AssertionFailedError if the array is `null` or does not have the ex
pected number | 334 * @throws AssertionFailedError if the array is `null` or does not have the ex
pected number |
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 void getContentsToReceiver(Source_ContentReceiver receiver) { | 991 void getContentsToReceiver(Source_ContentReceiver receiver) { |
992 throw new UnsupportedOperationException(); | 992 throw new UnsupportedOperationException(); |
993 } | 993 } |
994 Source resolve(String uri) { | 994 Source resolve(String uri) { |
995 throw new UnsupportedOperationException(); | 995 throw new UnsupportedOperationException(); |
996 } | 996 } |
997 Uri resolveRelativeUri(Uri uri) { | 997 Uri resolveRelativeUri(Uri uri) { |
998 return new Uri(scheme: 'file', path: _name).resolveUri(uri); | 998 return new Uri(scheme: 'file', path: _name).resolveUri(uri); |
999 } | 999 } |
1000 } | 1000 } |
OLD | NEW |