Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1055)

Unified Diff: pkg/barback/test/asset_id_test.dart

Issue 18650004: Make Assets know their ID. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/barback/test/asset_id_test.dart
diff --git a/pkg/barback/test/asset_id_test.dart b/pkg/barback/test/asset_id_test.dart
index 683403986336083eaa56a8be67665eb2bd9d8595..6e4a7d84db8370c567725c1aec576ff164bd2d56 100644
--- a/pkg/barback/test/asset_id_test.dart
+++ b/pkg/barback/test/asset_id_test.dart
@@ -32,4 +32,15 @@ main() {
expect(() => new AssetId.parse("app|"), throwsFormatException);
});
});
+
+ test("equals another ID with the same package and path", () {
+ expect(new AssetId.parse("foo|asset.txt"), equals(
+ new AssetId.parse("foo|asset.txt")));
+
+ expect(new AssetId.parse("foo|asset.txt"), isNot(equals(
+ new AssetId.parse("bar|asset.txt"))));
+
+ expect(new AssetId.parse("foo|asset.txt"), isNot(equals(
+ new AssetId.parse("bar|other.txt"))));
+ });
}

Powered by Google App Engine
This is Rietveld 408576698