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

Unified Diff: pkg/scheduled_test/test/unittest_compatibility_test.dart

Issue 179993007: Make scheduled_test play nicer with plain unittest tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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/scheduled_test/lib/scheduled_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/scheduled_test/test/unittest_compatibility_test.dart
diff --git a/pkg/scheduled_test/test/unittest_compatibility_test.dart b/pkg/scheduled_test/test/unittest_compatibility_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..1dc89885b9af4b4bd34eb4b80ef8da116aab88c3
--- /dev/null
+++ b/pkg/scheduled_test/test/unittest_compatibility_test.dart
@@ -0,0 +1,23 @@
+// 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.
+
+// This isn't a common use-case, but we want to make sure scheduled_test doesn't
+// step on unittest's toes too much.
+import 'dart:async';
+
+import 'package:scheduled_test/scheduled_test.dart' as scheduled_test;
+import 'package:unittest/unittest.dart' as unittest;
+
+void main() {
+ scheduled_test.test('scheduled_test throws', () {
+ scheduled_test.expect(new Future.error('foo'),
+ scheduled_test.throwsA('foo'));
+ });
+
+ unittest.test('unittest throws', () {
+ // We test a future matcher because scheduled_test modifies some of
+ // unittest's asynchrony infrastructure.
+ unittest.expect(new Future.error('foo'), unittest.throwsA('foo'));
+ });
+}
« no previous file with comments | « pkg/scheduled_test/lib/scheduled_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698