OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 yaml_test; | 5 library yaml_test; |
6 | 6 |
7 // TODO(rnystrom): rewrite tests so that they don't need "Expect". | 7 // TODO(rnystrom): rewrite tests so that they don't need "Expect". |
8 import "package:expect/expect.dart"; | 8 import "package:expect/expect.dart"; |
9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
10 import 'package:yaml/yaml.dart'; | 10 import 'package:yaml/yaml.dart'; |
(...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1343 - [ {JSON: like}:adjacent ]"""); | 1343 - [ {JSON: like}:adjacent ]"""); |
1344 }); | 1344 }); |
1345 | 1345 |
1346 test('[Example 7.22]', () { | 1346 test('[Example 7.22]', () { |
1347 Expect.throws(() => loadYaml(cleanUpLiteral( | 1347 Expect.throws(() => loadYaml(cleanUpLiteral( |
1348 """ | 1348 """ |
1349 [ foo | 1349 [ foo |
1350 bar: invalid ]"""))); | 1350 bar: invalid ]"""))); |
1351 | 1351 |
1352 // TODO(nweiz): enable this when we throw an error for long keys | 1352 // TODO(nweiz): enable this when we throw an error for long keys |
1353 // var dotList = []; | 1353 // var dotList = new List.filled(1024, ' '); |
1354 // dotList.insertRange(0, 1024, ' '); | |
1355 // var dots = dotList.join(); | 1354 // var dots = dotList.join(); |
1356 // Expect.throws(() => loadYaml('[ "foo...$dots...bar": invalid ]')); | 1355 // Expect.throws(() => loadYaml('[ "foo...$dots...bar": invalid ]')); |
1357 }); | 1356 }); |
1358 }); | 1357 }); |
1359 | 1358 |
1360 group('7.5: Flow Nodes', () { | 1359 group('7.5: Flow Nodes', () { |
1361 test('[Example 7.23]', () { | 1360 test('[Example 7.23]', () { |
1362 expectYamlLoads([["a", "b"], {"a": "b"}, "a", "b", "c"], | 1361 expectYamlLoads([["a", "b"], {"a": "b"}, "a", "b", "c"], |
1363 """ | 1362 """ |
1364 - [ a, b ] | 1363 - [ a, b ] |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1872 A null: null | 1871 A null: null |
1873 Also a null: # Empty | 1872 Also a null: # Empty |
1874 Not a null: "" | 1873 Not a null: "" |
1875 Booleans: [ true, True, false, FALSE ] | 1874 Booleans: [ true, True, false, FALSE ] |
1876 Integers: [ 0, 0o7, 0x3A, -19 ] | 1875 Integers: [ 0, 0o7, 0x3A, -19 ] |
1877 Floats: [ 0., -0.0, .5, +12e03, -2E+05 ] | 1876 Floats: [ 0., -0.0, .5, +12e03, -2E+05 ] |
1878 Also floats: [ .inf, -.Inf, +.INF, .NAN ]'''); | 1877 Also floats: [ .inf, -.Inf, +.INF, .NAN ]'''); |
1879 }); | 1878 }); |
1880 }); | 1879 }); |
1881 } | 1880 } |
OLD | NEW |