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 /// Test infrastructure for testing pub. Unlike typical unit tests, most pub | 5 /// Test infrastructure for testing pub. Unlike typical unit tests, most pub |
6 /// tests are integration tests that stage some stuff on the file system, run | 6 /// tests are integration tests that stage some stuff on the file system, run |
7 /// pub, and then validate the results. This library provides an API to build | 7 /// pub, and then validate the results. This library provides an API to build |
8 /// tests like that. | 8 /// tests like that. |
9 library test_pub; | 9 library test_pub; |
10 | 10 |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 case "git": | 464 case "git": |
465 source = new GitSource(); | 465 source = new GitSource(); |
466 break; | 466 break; |
467 case "hosted": | 467 case "hosted": |
468 source = new HostedSource(); | 468 source = new HostedSource(); |
469 break; | 469 break; |
470 case "path": | 470 case "path": |
471 source = new PathSource(); | 471 source = new PathSource(); |
472 break; | 472 break; |
473 default: | 473 default: |
474 throw 'Unknown source "$sourceName"'; | 474 throw new Exception('Unknown source "$sourceName"'); |
475 } | 475 } |
476 | 476 |
477 result[_packageName(sourceName, dependency[sourceName])] = dependency; | 477 result[_packageName(sourceName, dependency[sourceName])] = dependency; |
478 } | 478 } |
479 return result; | 479 return result; |
480 }); | 480 }); |
481 } | 481 } |
482 | 482 |
483 /// Return the name for the package described by [description] and from | 483 /// Return the name for the package described by [description] and from |
484 /// [sourceName]. | 484 /// [sourceName]. |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 bool matches(item, MatchState matchState) { | 610 bool matches(item, MatchState matchState) { |
611 if (item is! Pair) return false; | 611 if (item is! Pair) return false; |
612 return _firstMatcher.matches(item.first, matchState) && | 612 return _firstMatcher.matches(item.first, matchState) && |
613 _lastMatcher.matches(item.last, matchState); | 613 _lastMatcher.matches(item.last, matchState); |
614 } | 614 } |
615 | 615 |
616 Description describe(Description description) { | 616 Description describe(Description description) { |
617 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); | 617 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); |
618 } | 618 } |
619 } | 619 } |
OLD | NEW |