| 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('source_test'); | 5 #library('source_test'); |
| 6 | 6 |
| 7 #import('../../../lib/unittest/unittest.dart'); | 7 #import('../../../lib/unittest/unittest.dart'); |
| 8 #import('../../pub/pubspec.dart'); | 8 #import('../../pub/pubspec.dart'); |
| 9 #import('../../pub/source.dart'); | 9 #import('../../pub/source.dart'); |
| 10 #import('../../pub/source_registry.dart'); |
| 10 #import('../../pub/utils.dart'); | 11 #import('../../pub/utils.dart'); |
| 11 | 12 |
| 12 class MockSource extends Source { | 13 class MockSource extends Source { |
| 13 final String name = "mock"; | 14 final String name = "mock"; |
| 14 final bool shouldCache = false; | 15 final bool shouldCache = false; |
| 15 void validateDescription(description) { | 16 void validateDescription(description) { |
| 16 if (description != 'ok') throw new FormatException('Bad'); | 17 if (description != 'ok') throw new FormatException('Bad'); |
| 17 } | 18 } |
| 18 } | 19 } |
| 19 | 20 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 32 ''', sources); | 33 ''', sources); |
| 33 }); | 34 }); |
| 34 }); | 35 }); |
| 35 }); | 36 }); |
| 36 }); | 37 }); |
| 37 } | 38 } |
| 38 | 39 |
| 39 throwsBadFormat(function) { | 40 throwsBadFormat(function) { |
| 40 expectThrow(function, (e) => e is FormatException); | 41 expectThrow(function, (e) => e is FormatException); |
| 41 } | 42 } |
| OLD | NEW |