Chromium Code Reviews| 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(); |
| +} |