| 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 static void assertSizeOfSet(int expectedSize, Set set) { | 412 static void assertSizeOfSet(int expectedSize, Set set) { |
| 413 if (set == null) { | 413 if (set == null) { |
| 414 JUnitTestCase.fail("Expected set of size ${expectedSize}; found null"); | 414 JUnitTestCase.fail("Expected set of size ${expectedSize}; found null"); |
| 415 } else if (set.length != expectedSize) { | 415 } else if (set.length != expectedSize) { |
| 416 JUnitTestCase.fail( | 416 JUnitTestCase.fail( |
| 417 "Expected set of size ${expectedSize}; contained ${set.length} element
s"); | 417 "Expected set of size ${expectedSize}; contained ${set.length} element
s"); |
| 418 } | 418 } |
| 419 } | 419 } |
| 420 | 420 |
| 421 /** | 421 /** |
| 422 * Convert the given array of lines into a single source string. | |
| 423 * | |
| 424 * @param lines the lines to be merged into a single source string | |
| 425 * @return the source string composed of the given lines | |
| 426 */ | |
| 427 static String createSource(List<String> lines) { | |
| 428 StringBuffer buffer = new StringBuffer(); | |
| 429 for (String line in lines) { | |
| 430 buffer.writeln(line); | |
| 431 } | |
| 432 return buffer.toString(); | |
| 433 } | |
| 434 | |
| 435 /** | |
| 436 * @return the [AstNode] with requested type at offset of the "prefix". | 422 * @return the [AstNode] with requested type at offset of the "prefix". |
| 437 */ | 423 */ |
| 438 static AstNode findNode(AstNode root, String code, String prefix, | 424 static AstNode findNode(AstNode root, String code, String prefix, |
| 439 Predicate<AstNode> predicate) { | 425 Predicate<AstNode> predicate) { |
| 440 int offset = code.indexOf(prefix); | 426 int offset = code.indexOf(prefix); |
| 441 if (offset == -1) { | 427 if (offset == -1) { |
| 442 throw new IllegalArgumentException("Not found '$prefix'."); | 428 throw new IllegalArgumentException("Not found '$prefix'."); |
| 443 } | 429 } |
| 444 AstNode node = new NodeLocator.con1(offset).searchWithin(root); | 430 AstNode node = new NodeLocator.con1(offset).searchWithin(root); |
| 445 return node.getAncestor(predicate); | 431 return node.getAncestor(predicate); |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1010 void getContentsToReceiver(Source_ContentReceiver receiver) { | 996 void getContentsToReceiver(Source_ContentReceiver receiver) { |
| 1011 throw new UnsupportedOperationException(); | 997 throw new UnsupportedOperationException(); |
| 1012 } | 998 } |
| 1013 Source resolve(String uri) { | 999 Source resolve(String uri) { |
| 1014 throw new UnsupportedOperationException(); | 1000 throw new UnsupportedOperationException(); |
| 1015 } | 1001 } |
| 1016 Uri resolveRelativeUri(Uri uri) { | 1002 Uri resolveRelativeUri(Uri uri) { |
| 1017 return new Uri(scheme: 'file', path: _name).resolveUri(uri); | 1003 return new Uri(scheme: 'file', path: _name).resolveUri(uri); |
| 1018 } | 1004 } |
| 1019 } | 1005 } |
| OLD | NEW |