| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 // This code was auto-generated, is not intended to be edited, and is subject to | |
| 6 // significant change. Please see the README file for more information. | |
| 7 | |
| 8 library analysis_server.test.server_options; | |
| 9 | |
| 10 import 'package:analysis_server/src/server_options.dart'; | |
| 11 import 'package:test/test.dart'; | |
| 12 | |
| 13 void main() { | |
| 14 group('server_options', () { | |
| 15 test('basic - []', () { | |
| 16 var options = new ServerOptions.fromContents('''# ignored | |
| 17 foo: bar | |
| 18 baz: ${"padded "} | |
| 19 '''); | |
| 20 expect(options['foo'], equals('bar')); | |
| 21 expect(options['baz'], equals('padded')); | |
| 22 }); | |
| 23 test('basic - isSet', () { | |
| 24 var options = new ServerOptions.fromContents('''foo: true | |
| 25 bar: TRUE | |
| 26 baz: false | |
| 27 foobar: off | |
| 28 '''); | |
| 29 expect(options.isSet('foo'), isTrue); | |
| 30 expect(options.isSet('bar'), isTrue); | |
| 31 expect(options.isSet('baz'), isFalse); | |
| 32 expect(options.isSet('foobar'), isFalse); | |
| 33 expect(options.isSet('does_not_exist'), isFalse); | |
| 34 expect(options.isSet('does_not_exist', defaultValue: true), isTrue); | |
| 35 }); | |
| 36 | |
| 37 test('basic - getStringValue', () { | |
| 38 var options = new ServerOptions.fromContents('''foo: someValue | |
| 39 '''); | |
| 40 expect(options.getStringValue('foo'), equals('someValue')); | |
| 41 expect(options.getStringValue('not_there'), isNull); | |
| 42 expect(options.getStringValue('not_there', defaultValue: 'bar'), | |
| 43 equals('bar')); | |
| 44 }); | |
| 45 }); | |
| 46 } | |
| OLD | NEW |