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

Unified Diff: test/future_matchers_test.dart

Issue 867133002: pkg/matcher: refactor with unittest v0.12 work (Closed) Base URL: https://github.com/dart-lang/matcher.git@master
Patch Set: cl nits 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/core_matchers_test.dart ('k') | test/iterable_matchers_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 4e21ea2e41a5665fe76a4394fa3b94b0b5238688..0000000000000000000000000000000000000000
--- a/test/future_matchers_test.dart
+++ /dev/null
@@ -1,76 +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 matcher.future_matchers_test;
-
-import 'dart:async';
-
-import 'package:matcher/matcher.dart';
-import 'package:unittest/unittest.dart' show test, group;
-
-import 'test_utils.dart';
-
-void main() {
- initUtils();
-
- test('completes - unexpected error', () {
- var completer = new Completer();
- completer.completeError('X');
- shouldFail(completer.future, completes, contains(
- 'Expected future to complete successfully, '
- 'but it failed with X'), isAsync: true);
- });
-
- test('completes - successfully', () {
- var completer = new Completer();
- completer.complete('1');
- shouldPass(completer.future, completes, isAsync: true);
- });
-
- test('throws - unexpected to see normal completion', () {
- var completer = new Completer();
- completer.complete('1');
- shouldFail(completer.future, throws,
- contains("Expected future to fail, but succeeded with '1'"),
- isAsync: true);
- });
-
- test('throws - expected to see exception', () {
- var completer = new Completer();
- completer.completeError('X');
- shouldPass(completer.future, throws, isAsync: true);
- });
-
- test('throws - expected to see exception thrown later on', () {
- var completer = new Completer();
- var chained = completer.future.then((_) {
- throw 'X';
- });
- shouldPass(chained, throws, isAsync: true);
- completer.complete('1');
- });
-
- test('throwsA - unexpected normal completion', () {
- var completer = new Completer();
- completer.complete('1');
- shouldFail(completer.future, throwsA(equals('X')),
- contains("Expected future to fail, but succeeded with '1'"),
- isAsync: true);
- });
-
- test('throwsA - correct error', () {
- var completer = new Completer();
- completer.completeError('X');
- shouldPass(completer.future, throwsA(equals('X')), isAsync: true);
- });
-
- test('throwsA - wrong error', () {
- var completer = new Completer();
- completer.completeError('X');
- shouldFail(completer.future, throwsA(equals('Y')),
- "Expected: 'Y' Actual: 'X' "
- "Which: is different. "
- "Expected: Y Actual: X ^ Differ at offset 0", isAsync: true);
- });
-}
« no previous file with comments | « test/core_matchers_test.dart ('k') | test/iterable_matchers_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698