Chromium Code Reviews| Index: utils/tests/pub/yaml_test.dart |
| diff --git a/utils/tests/pub/yaml_test.dart b/utils/tests/pub/yaml_test.dart |
| index 8616f488012945c79a87db26ab7c82bc0a049f26..c8d7facddcd48c8be286ca21491e94483bc87bb4 100644 |
| --- a/utils/tests/pub/yaml_test.dart |
| +++ b/utils/tests/pub/yaml_test.dart |
| @@ -70,6 +70,21 @@ main() { |
| }); |
| }); |
| + group('has a friendly error message for', () { |
| + test('using a tab as indentation', () { |
| + Expect.throws(() => loadYaml('foo:\n\tbar'), |
|
Bob Nystrom
2012/08/30 16:43:51
expect(() => loadYaml('foo:\n\tbar'),
throwsA(
nweiz
2012/08/30 19:19:02
Done, although just "contains()" doesn't work here
|
| + (e) => e.toString().contains('\\t is not allowed as indentation')); |
| + }); |
| + |
| + test('using a tab not as indentation', () { |
| + Expect.throws(() => loadYaml(''' |
| + "foo |
| + \tbar" |
| + error'''), |
| + (e) => !e.toString().contains('\\t is not allowed as indentation')); |
|
Bob Nystrom
2012/08/30 16:43:51
Ditto.
We're trying to phase out all uses of Expe
nweiz
2012/08/30 19:19:02
Done.
|
| + }); |
| + }); |
| + |
| // The following tests are all taken directly from the YAML spec |
| // (http://www.yaml.org/spec/1.2/spec.html). Most of them are code examples |
| // that are directly included in the spec, but additional tests are derived |