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

Unified Diff: test/future_matchers_test.dart

Issue 934413002: Replace the existing unittest APIs with the new runner infrastructure. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Code review changes Created 5 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 | « test/expect_async_test.dart ('k') | test/group_name_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/future_matchers_test.dart
diff --git a/test/future_matchers_test.dart b/test/future_matchers_test.dart
deleted file mode 100644
index c09542c38c850722878f04e3b7c20a5ae326888b..0000000000000000000000000000000000000000
--- a/test/future_matchers_test.dart
+++ /dev/null
@@ -1,98 +0,0 @@
-// Copyright (c) 2012, 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 unittest.future_matchers_test;
-
-import 'dart:async';
-
-import 'package:metatest/metatest.dart';
-import 'package:unittest/unittest.dart';
-
-void main() => initTests(_test);
-
-void _test(message) {
- initMetatest(message);
-
- expectTestResults('group name test', () {
- test('completes - unexpected error', () {
- var completer = new Completer();
- completer.completeError('X');
- expect(completer.future, completes);
- });
-
- test('completes - successfully', () {
- var completer = new Completer();
- completer.complete('1');
- expect(completer.future, completes);
- });
-
- test('throws - unexpected to see normal completion', () {
- var completer = new Completer();
- completer.complete('1');
- expect(completer.future, throws);
- });
-
- test('throws - expected to see exception', () {
- var completer = new Completer();
- completer.completeError('X');
- expect(completer.future, throws);
- });
-
- test('throws - expected to see exception thrown later on', () {
- var completer = new Completer();
- var chained = completer.future.then((_) {
- throw 'X';
- });
- expect(chained, throws);
- completer.complete('1');
- });
-
- test('throwsA - unexpected normal completion', () {
- var completer = new Completer();
- completer.complete('1');
- expect(completer.future, throwsA(equals('X')));
- });
-
- test('throwsA - correct error', () {
- var completer = new Completer();
- completer.completeError('X');
- expect(completer.future, throwsA(equals('X')));
- });
-
- test('throwsA - wrong error', () {
- var completer = new Completer();
- completer.completeError('X');
- expect(completer.future, throwsA(equals('Y')));
- });
- }, [
- {
- 'result': 'fail',
- 'message': 'Expected future to complete successfully, but it failed with '
- 'X',
- },
- {'result': 'pass'},
- {
- 'result': 'fail',
- 'message': 'Expected future to fail, but succeeded with \'1\'.'
- },
- {'result': 'pass'},
- {'result': 'pass'},
- {
- 'result': 'fail',
- 'message': 'Expected future to fail, but succeeded with \'1\'.'
- },
- {'result': 'pass'},
- {
- 'result': 'fail',
- 'message': '''Expected: 'Y'
- Actual: 'X'
- Which: is different.
-Expected: Y
- Actual: X
- ^
- Differ at offset 0
-'''
- }
- ]);
-}
« no previous file with comments | « test/expect_async_test.dart ('k') | test/group_name_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698