| Index: tests/standalone/assert_test.dart
|
| ===================================================================
|
| --- tests/standalone/assert_test.dart (revision 25781)
|
| +++ tests/standalone/assert_test.dart (working copy)
|
| @@ -2,7 +2,9 @@
|
| // 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_asserts
|
| +
|
| // Dart test program testing assert statements.
|
| +
|
| import "package:expect/expect.dart";
|
|
|
| class AssertTest {
|
| @@ -11,15 +13,9 @@
|
| assert(false);
|
| Expect.fail("Assertion 'false' didn't fail.");
|
| } on AssertionError catch (error) {
|
| - Expect.equals("false", error.failedAssertion);
|
| - int pos = error.url.lastIndexOf("/", error.url.length);
|
| - if (pos == -1) {
|
| - pos = error.url.lastIndexOf("\\", error.url.length);
|
| - }
|
| - String subs = error.url.substring(pos + 1, error.url.length);
|
| - Expect.equals("assert_test.dart", subs);
|
| - Expect.equals(11, error.line);
|
| - Expect.equals(14, error.column);
|
| + Expect.isTrue(error.toString().contains("'false'"));
|
| + Expect.isTrue(error.stackTrace.toString().contains(
|
| + "assert_test.dart:13:14"));
|
| }
|
| }
|
| static testClosure() {
|
| @@ -27,15 +23,9 @@
|
| assert(() => false);
|
| Expect.fail("Assertion '() => false' didn't fail.");
|
| } on AssertionError catch (error) {
|
| - Expect.equals("() => false", error.failedAssertion);
|
| - int pos = error.url.lastIndexOf("/", error.url.length);
|
| - if (pos == -1) {
|
| - pos = error.url.lastIndexOf("\\", error.url.length);
|
| - }
|
| - String subs = error.url.substring(pos + 1, error.url.length);
|
| - Expect.equals("assert_test.dart", subs);
|
| - Expect.equals(27, error.line);
|
| - Expect.equals(14, error.column);
|
| + Expect.isTrue(error.toString().contains("'() => false'"));
|
| + Expect.isTrue(error.stackTrace.toString().contains(
|
| + "assert_test.dart:23:14"));
|
| }
|
| }
|
|
|
|
|