Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: pkg/unittest/test/unittest_invalid_ops_test.dart

Issue 142023005: throw when group or test is called while unittest system is running (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: nits Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/unittest/pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/test/unittest_invalid_ops_test.dart
diff --git a/pkg/unittest/test/unittest_invalid_ops_test.dart b/pkg/unittest/test/unittest_invalid_ops_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..e70d8a8815331e057f0b300297850dd52a5d0ab9
--- /dev/null
+++ b/pkg/unittest/test/unittest_invalid_ops_test.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library unittestTest;
+import 'dart:isolate';
+import 'dart:async';
+import 'package:unittest/unittest.dart';
+
+part 'unittest_test_utils.dart';
+
+var testName = 'invalid ops throw while test is running';
+
+var testFunction = (_) {
+ test(testName, () {
+ expect(() => test('test', () {}), throwsStateError);
+ expect(() => solo_test('test', () {}), throwsStateError);
+ expect(() => group('test', () {}), throwsStateError);
+ expect(() => solo_group('test', () {}), throwsStateError);
+ expect(() => setUp(() {}), throwsStateError);
+ expect(() => tearDown(() {}), throwsStateError);
+ expect(() => runTests(), throwsStateError);
+ expect(() => rerunTests(), throwsStateError);
+ });
+};
+
+var expected = buildStatusString(1, 0, 0, testName);
« no previous file with comments | « pkg/unittest/pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698