| 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:path/path.dart' as p; | 7 import 'package:path/path.dart' as p; |
| 8 import 'package:test/test.dart'; | 8 import 'package:test/test.dart'; |
| 9 | 9 |
| 10 import 'package:test/src/backend/test_platform.dart'; | 10 import 'package:test/src/backend/test_platform.dart'; |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 expect(merged.pubServeUrl.port, equals(5678)); | 131 expect(merged.pubServeUrl.port, equals(5678)); |
| 132 expect(merged.pattern, equals("gonk")); | 132 expect(merged.pattern, equals("gonk")); |
| 133 expect(merged.platforms, equals([TestPlatform.dartium])); | 133 expect(merged.platforms, equals([TestPlatform.dartium])); |
| 134 expect(merged.paths, equals(["blech"])); | 134 expect(merged.paths, equals(["blech"])); |
| 135 }); | 135 }); |
| 136 }); | 136 }); |
| 137 | 137 |
| 138 group("for tags", () { | 138 group("for tags", () { |
| 139 test("if neither is defined, preserves the default", () { | 139 test("if neither is defined, preserves the default", () { |
| 140 var merged = new Configuration().merge(new Configuration()); | 140 var merged = new Configuration().merge(new Configuration()); |
| 141 expect(merged.tags, isEmpty); | 141 expect(merged.includeTags, isEmpty); |
| 142 expect(merged.excludeTags, isEmpty); | 142 expect(merged.excludeTags, isEmpty); |
| 143 }); | 143 }); |
| 144 | 144 |
| 145 test("if only the old configuration's is defined, uses it", () { | 145 test("if only the old configuration's is defined, uses it", () { |
| 146 var merged = new Configuration( | 146 var merged = new Configuration( |
| 147 tags: ["foo", "bar"], | 147 includeTags: ["foo", "bar"], |
| 148 excludeTags: ["baz", "bang"]) | 148 excludeTags: ["baz", "bang"]) |
| 149 .merge(new Configuration()); | 149 .merge(new Configuration()); |
| 150 | 150 |
| 151 expect(merged.tags, unorderedEquals(["foo", "bar"])); | 151 expect(merged.includeTags, unorderedEquals(["foo", "bar"])); |
| 152 expect(merged.excludeTags, unorderedEquals(["baz", "bang"])); | 152 expect(merged.excludeTags, unorderedEquals(["baz", "bang"])); |
| 153 }); | 153 }); |
| 154 | 154 |
| 155 test("if only the new configuration's is defined, uses it", () { | 155 test("if only the new configuration's is defined, uses it", () { |
| 156 var merged = new Configuration().merge(new Configuration( | 156 var merged = new Configuration().merge(new Configuration( |
| 157 tags: ["foo", "bar"], | 157 includeTags: ["foo", "bar"], |
| 158 excludeTags: ["baz", "bang"])); | 158 excludeTags: ["baz", "bang"])); |
| 159 | 159 |
| 160 expect(merged.tags, unorderedEquals(["foo", "bar"])); | 160 expect(merged.includeTags, unorderedEquals(["foo", "bar"])); |
| 161 expect(merged.excludeTags, unorderedEquals(["baz", "bang"])); | 161 expect(merged.excludeTags, unorderedEquals(["baz", "bang"])); |
| 162 }); | 162 }); |
| 163 | 163 |
| 164 test("if both are defined, unions them", () { | 164 test("if both are defined, unions them", () { |
| 165 var older = new Configuration( | 165 var older = new Configuration( |
| 166 tags: ["foo", "bar"], | 166 includeTags: ["foo", "bar"], |
| 167 excludeTags: ["baz", "bang"]); | 167 excludeTags: ["baz", "bang"]); |
| 168 var newer = new Configuration( | 168 var newer = new Configuration( |
| 169 tags: ["bar", "blip"], | 169 includeTags: ["bar", "blip"], |
| 170 excludeTags: ["bang", "qux"]); | 170 excludeTags: ["bang", "qux"]); |
| 171 var merged = older.merge(newer); | 171 var merged = older.merge(newer); |
| 172 | 172 |
| 173 expect(merged.tags, unorderedEquals(["foo", "bar", "blip"])); | 173 expect(merged.includeTags, unorderedEquals(["foo", "bar", "blip"])); |
| 174 expect(merged.excludeTags, unorderedEquals(["baz", "bang", "qux"])); | 174 expect(merged.excludeTags, unorderedEquals(["baz", "bang", "qux"])); |
| 175 }); | 175 }); |
| 176 }); | 176 }); |
| 177 | 177 |
| 178 group("for timeout", () { | 178 group("for timeout", () { |
| 179 test("if neither is defined, preserves the default", () { | 179 test("if neither is defined, preserves the default", () { |
| 180 var merged = new Configuration().merge(new Configuration()); | 180 var merged = new Configuration().merge(new Configuration()); |
| 181 expect(merged.timeout, equals(new Timeout.factor(1))); | 181 expect(merged.timeout, equals(new Timeout.factor(1))); |
| 182 }); | 182 }); |
| 183 | 183 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 204 var older = new Configuration( | 204 var older = new Configuration( |
| 205 timeout: new Timeout(new Duration(seconds: 1))); | 205 timeout: new Timeout(new Duration(seconds: 1))); |
| 206 var newer = new Configuration( | 206 var newer = new Configuration( |
| 207 timeout: new Timeout(new Duration(seconds: 2))); | 207 timeout: new Timeout(new Duration(seconds: 2))); |
| 208 var merged = older.merge(newer); | 208 var merged = older.merge(newer); |
| 209 expect(merged.timeout, equals(new Timeout(new Duration(seconds: 2)))); | 209 expect(merged.timeout, equals(new Timeout(new Duration(seconds: 2)))); |
| 210 }); | 210 }); |
| 211 }); | 211 }); |
| 212 }); | 212 }); |
| 213 } | 213 } |
| OLD | NEW |