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

Unified Diff: packages/yaml/test/yaml_test.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packages/yaml/test/yaml_node_wrapper_test.dart ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/yaml/test/yaml_test.dart
diff --git a/packages/yaml/test/yaml_test.dart b/packages/yaml/test/yaml_test.dart
index c4601d50d23d6693d974880ccb99511532145815..8dee6c6fc369a64e2bdfa91f144c4d8ed4be59a0 100644
--- a/packages/yaml/test/yaml_test.dart
+++ b/packages/yaml/test/yaml_test.dart
@@ -2,8 +2,6 @@
// 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 yaml.test;
-
import 'package:test/test.dart';
import 'package:yaml/yaml.dart';
@@ -31,26 +29,37 @@ main() {
});
});
- group("refuses documents that declare version", () {
- test("1.0", () {
- expectYamlFails("""
- %YAML 1.0
- --- text
- """);
+ group("refuses", () {
+ // Regression test for #19.
+ test("invalid contents", () {
+ expectYamlFails("{");
});
- test("1.3", () {
- expectYamlFails("""
- %YAML 1.3
- --- text
- """);
+ test("duplicate mapping keys", () {
+ expectYamlFails("{a: 1, a: 2}");
});
- test("2.0", () {
- expectYamlFails("""
- %YAML 2.0
+ group("documents that declare version", () {
+ test("1.0", () {
+ expectYamlFails("""
+ %YAML 1.0
--- text
""");
+ });
+
+ test("1.3", () {
+ expectYamlFails("""
+ %YAML 1.3
+ --- text
+ """);
+ });
+
+ test("2.0", () {
+ expectYamlFails("""
+ %YAML 2.0
+ --- text
+ """);
+ });
});
});
@@ -59,14 +68,14 @@ main() {
- foo:
bar
- 123
-""");
+""") as YamlList;
expect(yaml.span.start.line, equals(0));
expect(yaml.span.start.column, equals(0));
expect(yaml.span.end.line, equals(3));
expect(yaml.span.end.column, equals(0));
- var map = yaml.nodes.first;
+ var map = yaml.nodes.first as YamlMap;
expect(map.span.start.line, equals(0));
expect(map.span.start.column, equals(2));
expect(map.span.end.line, equals(2));
« no previous file with comments | « packages/yaml/test/yaml_node_wrapper_test.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698