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

Unified Diff: tests/language/src/AssertionTest.dart

Issue 8276014: Update assert to follow the spec. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 2 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
Index: tests/language/src/AssertionTest.dart
===================================================================
--- tests/language/src/AssertionTest.dart (revision 0)
+++ tests/language/src/AssertionTest.dart (revision 0)
@@ -0,0 +1,36 @@
+// Copyright (c) 2011, 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.
+// VMOptions=--enable_type_checks
+//
+// Dart test program testing assert statements.
+
+class AssertionTest {
John Lenz 2011/10/13 20:09:40 This is a fork of AssertTest for three change: - u
jat 2011/10/13 21:03:01 Should the other test remain then if it doesn't co
ahe 2011/10/13 21:19:41 If this is a fork, why is there no version history
John Lenz 2011/10/13 21:35:43 That is what I want Peter to tell me. Is the orig
John Lenz 2011/10/13 21:35:43 I will correct this (svn cp are a pain to patch).
John Lenz 2011/10/13 21:51:08 In case you were waiting for the "svn cp" to be do
ahe 2011/10/14 10:45:40 AssertionError according to the specification.
John Lenz 2011/10/14 19:27:04 great, I'll check this in then.
+ static test() {
+ int i = 0;
+ try {
+ assert(false);
+ } catch (AssertionError error) {
+ i = 1;
+ }
+ return i;
+ }
+ static testClosure() {
+ int i = 0;
+ try {
+ assert(() => false);
+ } catch (AssertionError error) {
+ i = 1;
+ }
+ return i;
+ }
+
+ static testMain() {
+ Expect.equals(1, test());
+ Expect.equals(1, testClosure());
+ }
+}
+
+main() {
+ AssertionTest.testMain();
+}

Powered by Google App Engine
This is Rietveld 408576698