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

Unified Diff: tests/language/bool_check_test.dart

Issue 772513003: Revert r42145 to fix co19 tests (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years 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 | « runtime/vm/intermediate_language_x64.cc ('k') | tests/language/vm/type_vm_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/bool_check_test.dart
===================================================================
--- tests/language/bool_check_test.dart (revision 42146)
+++ tests/language/bool_check_test.dart (working copy)
@@ -1,54 +0,0 @@
-// Copyright (c) 2014, 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.
-
-import "package:expect/expect.dart";
-
-bool typeChecksEnabled() {
- try {
- var i = 42;
- String s = i;
- } on TypeError catch (e) {
- return true;
- }
- return false;
-}
-
-bool assertionsEnabled() {
- try {
- assert(false);
- return false;
- } on AssertionError catch (e) {
- return true;
- }
- return false;
-}
-
-final bool typeChecksOn = typeChecksEnabled();
-final bool assertionsOn = assertionsEnabled();
-
-ifExpr(e) { if (e) return true; else return false; }
-bool ifNull() => ifExpr(null);
-bool ifString() => ifExpr("true");
-
-main() {
- print("type checks: $typeChecksOn");
- print("assertions: $assertionsOn");
-
- if (typeChecksOn) {
- Expect.throws(ifNull, (e) => e is AssertionError);
- }
- if (assertionsOn && !typeChecksOn) {
- Expect.throws(ifNull, (e) => e is AssertionError);
- }
- if (!typeChecksOn && !assertionsOn) {
- Expect.identical(false, ifNull());
- }
-
- if (!typeChecksOn) {
- Expect.identical(false, ifString());
- }
- if (typeChecksOn) {
- Expect.throws(ifString, (e) => e is TypeError);
- }
-}
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | tests/language/vm/type_vm_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698