dart-sdk/tests/compiler/dartdevc_native/utils.dart
Nicholas Shahan 750a83b896 [dartdevc] Fix crash when source files contain non-UTF8 characters
* Treat the assertion condition offset as a character offset in the file.
* Allow unrecognized characters to be replaced by a placeholder character. This
  is unrelated to the fix but is just a precautionary measure.

Fixed: 39271
Change-Id: I4871ea41d3a46d26ecac5047265a1dbc1c889350
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124602
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-08 23:10:59 +00:00

12 lines
479 B
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 "package:expect/expect.dart";
/// Expects that [expected] appears as a substring in [actual].
expectStringContains(String expected, String actual) {
Expect.isTrue(actual.contains(expected),
'Failure: "$expected" should appear in: "$actual".');
}