| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 import "package:compiler/src/platform_configuration.dart"; | 5 import "package:compiler/src/platform_configuration.dart"; |
| 6 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
| 7 | 7 |
| 8 /// Runs the parser on [input] and compares it with [expectedResult] | 8 /// Runs the parser on [input] and compares it with [expectedResult] |
| 9 /// | 9 /// |
| 10 /// A '*' in [input] indicates that the parser will report an error at the | 10 /// A '*' in [input] indicates that the parser will report an error at the |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // Ok. | 84 // Ok. |
| 85 test( | 85 test( |
| 86 """ | 86 """ |
| 87 [AA] | 87 [AA] |
| 88 name:value | 88 name:value |
| 89 [BB] | 89 [BB] |
| 90 name:value | 90 name:value |
| 91 name2:value2 | 91 name2:value2 |
| 92 """, | 92 """, |
| 93 { | 93 { |
| 94 "AA": {"name": "value"}, | 94 "AA": {"name": "value"}, |
| 95 "BB": {"name": "value", "name2": "value2"} | 95 "BB": {"name": "value", "name2": "value2"} |
| 96 }); | 96 }); |
| 97 | 97 |
| 98 // Ok, file not ending in newline. | 98 // Ok, file not ending in newline. |
| 99 test( | 99 test( |
| 100 """ | 100 """ |
| 101 [AA] | 101 [AA] |
| 102 name:value""", | 102 name:value""", |
| 103 { | 103 { |
| 104 "A": {"name": "value"} | 104 "A": {"name": "value"} |
| 105 }); | 105 }); |
| 106 | 106 |
| 107 // Ok, whitespace is trimmed away. | 107 // Ok, whitespace is trimmed away. |
| 108 test( | 108 test( |
| 109 """ | 109 """ |
| 110 [ AA ] | 110 [ AA ] |
| 111 name\t: value """, | 111 name\t: value """, |
| 112 { | 112 { |
| 113 "A": {"name": "value"} | 113 "A": {"name": "value"} |
| 114 }); | 114 }); |
| 115 | 115 |
| 116 // Duplicate property name. | 116 // Duplicate property name. |
| 117 test(""" | 117 test(""" |
| 118 [AA] | 118 [AA] |
| 119 a:b | 119 a:b |
| 120 b:c | 120 b:c |
| 121 *a:c | 121 *a:c |
| 122 """); | 122 """); |
| 123 | 123 |
| 124 // No ':' on property line. | 124 // No ':' on property line. |
| 125 test(""" | 125 test(""" |
| 126 [AA] | 126 [AA] |
| 127 *name1 | 127 *name1 |
| 128 name2:value | 128 name2:value |
| 129 """); | 129 """); |
| 130 } | 130 } |
| OLD | NEW |