Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 // VMOptions=--enable_type_checks | |
| 5 // | |
| 6 // Dart test program testing assert statements. | |
| 7 | |
| 8 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.
| |
| 9 static test() { | |
| 10 int i = 0; | |
| 11 try { | |
| 12 assert(false); | |
| 13 } catch (AssertionError error) { | |
| 14 i = 1; | |
| 15 } | |
| 16 return i; | |
| 17 } | |
| 18 static testClosure() { | |
| 19 int i = 0; | |
| 20 try { | |
| 21 assert(() => false); | |
| 22 } catch (AssertionError error) { | |
| 23 i = 1; | |
| 24 } | |
| 25 return i; | |
| 26 } | |
| 27 | |
| 28 static testMain() { | |
| 29 Expect.equals(1, test()); | |
| 30 Expect.equals(1, testClosure()); | |
| 31 } | |
| 32 } | |
| 33 | |
| 34 main() { | |
| 35 AssertionTest.testMain(); | |
| 36 } | |
| OLD | NEW |