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

Unified Diff: test/browser/minitest.dart

Issue 1243503007: fixes #221, initial sync*, async, async* implementation (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 5 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/browser/language_tests.js ('k') | test/browser/runtime_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/browser/minitest.dart
diff --git a/test/browser/minitest.dart b/test/browser/minitest.dart
deleted file mode 100644
index 96f0b2fa8c1a89328516a9ebe4ba25eec87f996d..0000000000000000000000000000000000000000
--- a/test/browser/minitest.dart
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (c) 2015, 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.
-
-// TODO(jmesserly): replace this with the real package:test.
-// Not possible yet because it uses on async/await which we don't support.
-library minitest;
-
-import 'dom.dart';
-
-final console = (window as dynamic).console;
-
-void group(String name, void body()) {
- console.group(name);
- body();
- console.groupEnd(name);
-}
-
-void test(String name, void body(), {String skip}) {
- if (skip != null) {
- console.warn('SKIP $name: $skip');
- return;
- }
- console.log(name);
- try {
- body();
- } catch(e) {
- console.error(e);
- }
-}
-
-void expect(Object actual, matcher) {
- if (matcher is! Matcher) matcher = equals(matcher);
- if (!matcher(actual)) {
- throw 'Expect failed to match $actual with $matcher';
- }
-}
-
-Matcher equals(Object expected) {
- return (actual) {
- if (expected is List && actual is List) {
- int len = expected.length;
- if (len != actual.length) return false;
- for (int i = 0; i < len; i++) {
- if (!equals(expected[i])(actual[i])) return false;
- }
- return true;
- } else {
- return expected == actual;
- }
- };
-}
-
-Matcher same(Object expected) => (actual) => identical(expected, actual);
-Matcher isNot(matcher) {
- if (matcher is! Matcher) matcher = equals(matcher);
- return (actual) => !matcher(actual);
-}
-
-bool isNull(actual) => actual == null;
-final Matcher isNotNull = isNot(isNull);
-bool isRangeError(actual) => actual is RangeError;
-bool isNoSuchMethodError(actual) => actual is NoSuchMethodError;
-
-Matcher throwsA(matcher) {
- if (matcher is! Matcher) matcher = equals(matcher);
- return (actual) {
- try {
- actual();
- return false;
- } catch(e) {
- return matcher(e);
- }
- };
-}
-
-final Matcher throws = throwsA((a) => true);
-
-typedef Matcher(actual);
« no previous file with comments | « test/browser/language_tests.js ('k') | test/browser/runtime_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698