Chromium Code Reviews| 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 |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e30b20a5861782ecace5f75bb8e2867229ec475a |
| --- /dev/null |
| +++ b/pkg/barback/test/asset_id_test.dart |
| @@ -0,0 +1,26 @@ |
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| +library barback.test.asset_id_test; |
| + |
| +import 'dart:async'; |
| + |
| +import 'package:barback/barback.dart'; |
| +import 'package:unittest/unittest.dart'; |
| + |
| +import 'utils.dart'; |
| + |
| +main() { |
| + initConfig(); |
| + group("parse", () { |
| + test("parses the package and path", () { |
| + var id = new AssetId.parse("package|path/to/asset.txt"); |
| + expect(id.package, equals("package")); |
| + expect(id.path, equals("path/to/asset.txt")); |
| + }); |
| + |
| + test("throws if there are multiple '|'", () { |
| + expect(() => new AssetId.parse("app|path|wtf"), throwsFormatException); |
| + }); |
| + }); |
|
nweiz
2013/06/18 23:14:46
Other edge cases: empty package string, empty path
Bob Nystrom
2013/06/20 00:23:59
Done.
|
| +} |