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 'package:barback/barback.dart'; | 7 import 'package:barback/barback.dart'; |
8 import 'package:unittest/unittest.dart'; | 8 import 'package:unittest/unittest.dart'; |
9 | 9 |
10 import 'utils.dart'; | 10 import 'utils.dart'; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 expect(id.path, equals("path/to/asset.txt")); | 47 expect(id.path, equals("path/to/asset.txt")); |
48 }); | 48 }); |
49 | 49 |
50 test("normalizes backslashes to slashes in the path", () { | 50 test("normalizes backslashes to slashes in the path", () { |
51 var id = new AssetId.parse(r"app|path\to/asset.txt"); | 51 var id = new AssetId.parse(r"app|path\to/asset.txt"); |
52 expect(id.path, equals("path/to/asset.txt")); | 52 expect(id.path, equals("path/to/asset.txt")); |
53 }); | 53 }); |
54 }); | 54 }); |
55 | 55 |
56 test("equals another ID with the same package and path", () { | 56 test("equals another ID with the same package and path", () { |
57 expect(new AssetId.parse("foo|asset.txt"), equals( | 57 expect(new AssetId.parse("foo|asset.txt"), |
58 new AssetId.parse("foo|asset.txt"))); | 58 equals(new AssetId.parse("foo|asset.txt"))); |
59 | 59 |
60 expect(new AssetId.parse("foo|asset.txt"), isNot(equals( | 60 expect(new AssetId.parse("foo|asset.txt"), |
61 new AssetId.parse("bar|asset.txt")))); | 61 isNot(equals(new AssetId.parse("bar|asset.txt")))); |
62 | 62 |
63 expect(new AssetId.parse("foo|asset.txt"), isNot(equals( | 63 expect(new AssetId.parse("foo|asset.txt"), |
64 new AssetId.parse("bar|other.txt")))); | 64 isNot(equals(new AssetId.parse("bar|other.txt")))); |
65 }); | 65 }); |
66 } | 66 } |
OLD | NEW |