mirror of
https://github.com/dart-lang/sdk
synced 2024-11-05 18:22:09 +00:00
More test fixes.
Review URL: https://codereview.chromium.org//13749009 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21090 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
f0fac32cfb
commit
2a9ddbc93d
3 changed files with 33 additions and 2 deletions
|
@ -11,12 +11,15 @@ const lazy = const DeferredLibrary('deferred_class_library');
|
|||
isNoSuchMethodError(e) => e is NoSuchMethodError;
|
||||
|
||||
class Expect {
|
||||
static void isTrue(x) => expect.equals(true, x);
|
||||
static void isTrue(x) => Expect.equals(true, x);
|
||||
static void isFalse(x) => Expect.equals(false, x);
|
||||
|
||||
static void equals(expected, actual) {
|
||||
if (expected != actual) {
|
||||
throw "Not equal. Expected: $expected. Got: $actual";
|
||||
}
|
||||
}
|
||||
|
||||
static void throws(fun, [test]) {
|
||||
try {
|
||||
fun();
|
||||
|
@ -26,6 +29,8 @@ class Expect {
|
|||
}
|
||||
throw "didn't throw";
|
||||
}
|
||||
|
||||
static void isNull(x) => expect.equals(null, x);
|
||||
}
|
||||
|
||||
main() {
|
||||
|
|
|
@ -8,6 +8,29 @@ import 'dart:async';
|
|||
|
||||
const lazy = const DeferredLibrary('deferred_class_library');
|
||||
|
||||
class Expect {
|
||||
static void isTrue(x) => Expect.equals(true, x);
|
||||
static void isFalse(x) => Expect.equals(false, x);
|
||||
|
||||
static void equals(expected, actual) {
|
||||
if (expected != actual) {
|
||||
throw "Not equal. Expected: $expected. Got: $actual";
|
||||
}
|
||||
}
|
||||
|
||||
static void throws(fun, [test]) {
|
||||
try {
|
||||
fun();
|
||||
} catch (e) {
|
||||
if (!test(e)) throw "doesn't satisfy exception test";
|
||||
return;
|
||||
}
|
||||
throw "didn't throw";
|
||||
}
|
||||
|
||||
static void isNull(x) => expect.equals(null, x);
|
||||
}
|
||||
|
||||
main() {
|
||||
var x;
|
||||
// TODO(ahe): What are the semantics of this:
|
||||
|
|
|
@ -13,7 +13,10 @@ const lazy = const DeferredLibrary('deferred_function_library');
|
|||
isNoSuchMethodError(e) => e is NoSuchMethodError;
|
||||
|
||||
class Expect {
|
||||
static void isTrue(x) => expect.equals(true, x);
|
||||
static void isTrue(x) => Expect.equals(true, x);
|
||||
|
||||
static void isFalse(x) => Expect.equals(true, x);
|
||||
|
||||
static void equals(expected, actual) {
|
||||
if (expected != actual) {
|
||||
throw "Not equal. Expected: $expected. Got: $actual";
|
||||
|
|
Loading…
Reference in a new issue