| 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 library barback.test.asset_id_test; | 5 library barback.test.asset_id_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:barback/barback.dart'; | 9 import 'package:barback/barback.dart'; |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 }); | 25 }); |
| 26 | 26 |
| 27 test("throws if the package name is empty '|'", () { | 27 test("throws if the package name is empty '|'", () { |
| 28 expect(() => new AssetId.parse("|asset.txt"), throwsFormatException); | 28 expect(() => new AssetId.parse("|asset.txt"), throwsFormatException); |
| 29 }); | 29 }); |
| 30 | 30 |
| 31 test("throws if the path is empty '|'", () { | 31 test("throws if the path is empty '|'", () { |
| 32 expect(() => new AssetId.parse("app|"), throwsFormatException); | 32 expect(() => new AssetId.parse("app|"), throwsFormatException); |
| 33 }); | 33 }); |
| 34 }); | 34 }); |
| 35 |
| 36 test("equals another ID with the same package and path", () { |
| 37 expect(new AssetId.parse("foo|asset.txt"), equals( |
| 38 new AssetId.parse("foo|asset.txt"))); |
| 39 |
| 40 expect(new AssetId.parse("foo|asset.txt"), isNot(equals( |
| 41 new AssetId.parse("bar|asset.txt")))); |
| 42 |
| 43 expect(new AssetId.parse("foo|asset.txt"), isNot(equals( |
| 44 new AssetId.parse("bar|other.txt")))); |
| 45 }); |
| 35 } | 46 } |
| OLD | NEW |