dart-sdk/tests/dartdevc/assertion_failure_message_test.dart
Joshua Litt f0625ac010 [dartdevc] Move opted out tests to tests/dartdevc and optin.
Change-Id: Ia032182ae94e9215c22fe1627dc93495946d4074
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151640
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-06-18 18:46:16 +00:00

30 lines
1.1 KiB
Dart

// Copyright (c) 2019, 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.
import "utils.dart";
void main() {
try {
assert(false, "failure message");
} on AssertionError catch (error) {
var message = error.toString();
expectStringContains('Assertion failed:', message);
expectStringContains('assertion_failure_message_test.dart:9:12', message);
expectStringContains('false', message);
expectStringContains('failure message', message);
}
// 失 All offsets and source code extractions should still be correct after
// non-UTF8 characters. See: https://github.com/dart-lang/sdk/issues/39271
try {
assert(false, "after a non-UTF8 character");
} on AssertionError catch (error) {
var message = error.toString();
expectStringContains('Assertion failed:', message);
expectStringContains('assertion_failure_message_test.dart:21:12', message);
expectStringContains('false', message);
expectStringContains('after a non-UTF8 character', message);
}
}