OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 @TestOn("vm") | 5 @TestOn("vm") |
6 | 6 |
7 import 'package:boolean_selector/boolean_selector.dart'; | 7 import 'package:boolean_selector/boolean_selector.dart'; |
8 import 'package:path/path.dart' as p; | 8 import 'package:path/path.dart' as p; |
9 import 'package:test/test.dart'; | 9 import 'package:test/test.dart'; |
10 | 10 |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 | 256 |
257 test("if the merge conflicts, prefers the new value", () { | 257 test("if the merge conflicts, prefers the new value", () { |
258 var older = new Configuration( | 258 var older = new Configuration( |
259 timeout: new Timeout(new Duration(seconds: 1))); | 259 timeout: new Timeout(new Duration(seconds: 1))); |
260 var newer = new Configuration( | 260 var newer = new Configuration( |
261 timeout: new Timeout(new Duration(seconds: 2))); | 261 timeout: new Timeout(new Duration(seconds: 2))); |
262 var merged = older.merge(newer); | 262 var merged = older.merge(newer); |
263 expect(merged.timeout, equals(new Timeout(new Duration(seconds: 2)))); | 263 expect(merged.timeout, equals(new Timeout(new Duration(seconds: 2)))); |
264 }); | 264 }); |
265 }); | 265 }); |
| 266 |
| 267 group("for onPlatform", () { |
| 268 test("merges each nested configuration", () { |
| 269 var merged = new Configuration( |
| 270 onPlatform: { |
| 271 new PlatformSelector.parse("vm"): new Configuration(verboseTrace: tr
ue), |
| 272 new PlatformSelector.parse("chrome"): new Configuration(jsTrace: tru
e) |
| 273 } |
| 274 ).merge(new Configuration( |
| 275 onPlatform: { |
| 276 new PlatformSelector.parse("chrome"): new Configuration(jsTrace: fal
se), |
| 277 new PlatformSelector.parse("firefox"): new Configuration(skip: true) |
| 278 } |
| 279 )); |
| 280 |
| 281 expect(merged.onPlatform[new PlatformSelector.parse("vm")].verboseTrace, |
| 282 isTrue); |
| 283 expect(merged.onPlatform[new PlatformSelector.parse("chrome")].jsTrace, |
| 284 isFalse); |
| 285 expect(merged.onPlatform[new PlatformSelector.parse("firefox")].skip, |
| 286 isTrue); |
| 287 }); |
| 288 }); |
266 }); | 289 }); |
267 } | 290 } |
OLD | NEW |