| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library barback.test.asset_id_test; |
| 6 |
| 7 import 'dart:async'; |
| 8 |
| 9 import 'package:barback/barback.dart'; |
| 10 import 'package:unittest/unittest.dart'; |
| 11 |
| 12 import 'utils.dart'; |
| 13 |
| 14 main() { |
| 15 initConfig(); |
| 16 group("parse", () { |
| 17 test("parses the package and path", () { |
| 18 var id = new AssetId.parse("package|path/to/asset.txt"); |
| 19 expect(id.package, equals("package")); |
| 20 expect(id.path, equals("path/to/asset.txt")); |
| 21 }); |
| 22 |
| 23 test("throws if there are multiple '|'", () { |
| 24 expect(() => new AssetId.parse("app|path|wtf"), throwsFormatException); |
| 25 }); |
| 26 |
| 27 test("throws if the package name is empty '|'", () { |
| 28 expect(() => new AssetId.parse("|asset.txt"), throwsFormatException); |
| 29 }); |
| 30 |
| 31 test("throws if the path is empty '|'", () { |
| 32 expect(() => new AssetId.parse("app|"), throwsFormatException); |
| 33 }); |
| 34 }); |
| 35 } |
| OLD | NEW |