| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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("test_options_parser"); | 5 #library("test_options_parser"); |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Specification of a single test option. | 8 * Specification of a single test option. |
| 9 * | 9 * |
| 10 * The name of the specification is used as the key for the option in | 10 * The name of the specification is used as the key for the option in |
| 11 * the Map returned from the [TestOptionParser] parse method. | 11 * the Map returned from the [TestOptionParser] parse method. |
| 12 */ | 12 */ |
| 13 class _TestOptionSpecification { | 13 class _TestOptionSpecification { |
| 14 _TestOptionSpecification(this.name, | 14 _TestOptionSpecification(this.name, |
| 15 this.description, | 15 this.description, |
| 16 this.keys, | 16 this.keys, |
| 17 this.values, | 17 this.values, |
| 18 this.defaultValue, | 18 this.defaultValue, |
| 19 [this.type = 'string']); | 19 [this.type = 'string']); |
| 20 String name; | 20 String name; |
| 21 String description; | 21 String description; |
| 22 List<String> keys; | 22 List<String> keys; |
| 23 List<String> values; | 23 List<String> values; |
| 24 String defaultValue; | 24 var defaultValue; |
| 25 String type; | 25 String type; |
| 26 } | 26 } |
| 27 | 27 |
| 28 | 28 |
| 29 /** | 29 /** |
| 30 * Parser of test options. | 30 * Parser of test options. |
| 31 */ | 31 */ |
| 32 class TestOptionsParser { | 32 class TestOptionsParser { |
| 33 /** | 33 /** |
| 34 * Creates a test options parser initialized with the known options. | 34 * Creates a test options parser initialized with the known options. |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 if (option.keys.some((key) => key == name)) { | 300 if (option.keys.some((key) => key == name)) { |
| 301 return option; | 301 return option; |
| 302 } | 302 } |
| 303 } | 303 } |
| 304 return null; | 304 return null; |
| 305 } | 305 } |
| 306 | 306 |
| 307 | 307 |
| 308 List<_TestOptionSpecification> _options; | 308 List<_TestOptionSpecification> _options; |
| 309 } | 309 } |
| OLD | NEW |