| 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 @TestOn("vm") | 5 @TestOn("vm") |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:test/src/backend/group.dart'; | 9 import 'package:test/src/backend/group.dart'; |
| 10 import 'package:test/src/backend/state.dart'; | 10 import 'package:test/src/backend/state.dart'; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 var liveTest = await (suite.group.entries.single as Test).load(suite); | 140 var liveTest = await (suite.group.entries.single as Test).load(suite); |
| 141 await liveTest.run(); | 141 await liveTest.run(); |
| 142 expectTestPassed(liveTest); | 142 expectTestPassed(liveTest); |
| 143 }); | 143 }); |
| 144 | 144 |
| 145 test("doesn't run change() if the suite is null", () async { | 145 test("doesn't run change() if the suite is null", () async { |
| 146 var suite = new LoadSuite("name", SuiteConfiguration.empty, () => null); | 146 var suite = new LoadSuite("name", SuiteConfiguration.empty, () => null); |
| 147 expect(suite.group.entries, hasLength(1)); | 147 expect(suite.group.entries, hasLength(1)); |
| 148 | 148 |
| 149 var newSuite = suite.changeSuite(expectAsync((_) {}, count: 0)); | 149 var newSuite = suite.changeSuite(expectAsync1((_) {}, count: 0)); |
| 150 expect(newSuite.suite, completion(isNull)); | 150 expect(newSuite.suite, completion(isNull)); |
| 151 | 151 |
| 152 var liveTest = await (suite.group.entries.single as Test).load(suite); | 152 var liveTest = await (suite.group.entries.single as Test).load(suite); |
| 153 await liveTest.run(); | 153 await liveTest.run(); |
| 154 expectTestPassed(liveTest); | 154 expectTestPassed(liveTest); |
| 155 }); | 155 }); |
| 156 }); | 156 }); |
| 157 | 157 |
| 158 group("getSuite()", () { | 158 group("getSuite()", () { |
| 159 test("runs the test and returns the suite", () { | 159 test("runs the test and returns the suite", () { |
| 160 var suite = new LoadSuite.forSuite(innerSuite); | 160 var suite = new LoadSuite.forSuite(innerSuite); |
| 161 expect(suite.group.entries, hasLength(1)); | 161 expect(suite.group.entries, hasLength(1)); |
| 162 | 162 |
| 163 expect(suite.getSuite(), completion(equals(innerSuite))); | 163 expect(suite.getSuite(), completion(equals(innerSuite))); |
| 164 }); | 164 }); |
| 165 | 165 |
| 166 test("forwards errors to the future", () { | 166 test("forwards errors to the future", () { |
| 167 var suite = new LoadSuite("name", SuiteConfiguration.empty, | 167 var suite = new LoadSuite("name", SuiteConfiguration.empty, |
| 168 () => throw "error"); | 168 () => throw "error"); |
| 169 expect(suite.group.entries, hasLength(1)); | 169 expect(suite.group.entries, hasLength(1)); |
| 170 | 170 |
| 171 expect(suite.getSuite(), throwsA("error")); | 171 expect(suite.getSuite(), throwsA("error")); |
| 172 }); | 172 }); |
| 173 }); | 173 }); |
| 174 } | 174 } |
| OLD | NEW |