Chromium Code Reviews| Index: frog/tests/leg_only/src/FactoryTest.dart |
| =================================================================== |
| --- frog/tests/leg_only/src/FactoryTest.dart (revision 0) |
| +++ frog/tests/leg_only/src/FactoryTest.dart (revision 0) |
| @@ -0,0 +1,20 @@ |
| +// 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. |
| + |
| +void expectEquals(var expected, var actual) { |
|
kasperl
2011/12/22 11:34:42
How hard would it be to move this to something ala
ngeoffray
2011/12/22 13:07:02
Looks like you just did it :)
|
| + if (expected != actual) { |
| + print("Actual does not match expected"); |
| + throw actual; |
| + } |
| +} |
| + |
| +class A { |
| + factory A() { |
| + return 1; |
| + } |
| +} |
| + |
| +main() { |
| + expectEquals(1, new A()); |
| +} |