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

Side by Side 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: Don't make AssetSet implement Set<T>. Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698