blob: ef677ad0e22f9d74cf4fbd612f1a052e4efdc6ed [file] [log] [blame]
/*
* 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.
*/
/**
* @assertion AssertionError class
* Error thrown by the runtime system when an assert statement fails.
* Implements Error
* @description Checks that when an assert statement fails, an AssertionError is thrown.
* Checks that AssertionError implements Error.
* @author rodionov
* @reviewer msyabro
* @needsreview undocumented
*/
import "../../../Utils/dynamic_check.dart";
import "../../../Utils/expect.dart";
main() {
if(!isCheckedMode()) {
return;
}
try {
assert(false);
Expect.fail("AssertionError expected");
} on AssertionError catch(e) {
Expect.isTrue(e is Error);
}
}