Files
sdk/runtime/tests/vm/dart_2/error_stacktrace_test.dart
T
Johnni Winther 43c00097c2 [cfe] Remove isOptOutTest work-around
Change-Id: I7dd125508bba256eb4c78b02fb24e433f45b129a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205420
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-08-04 10:44:00 +00:00

34 lines
857 B
Dart

// Copyright (c) 2013, 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.
// Test that the full stacktrace in an error object matches the stacktrace
// handed to the catch clause.
// @dart = 2.9
library test.error_stacktrace;
import "package:expect/expect.dart";
class C {
// operator*(o) is missing to trigger a noSuchMethodError when a C object
// is used in the multiplication below.
}
bar(c) => c * 4;
foo(c) => bar(c);
main() {
try {
var a = foo(new C());
} catch (e, s) {
print(e);
print("###");
print(e.stackTrace);
print("###");
print(s);
print("###");
Expect.isTrue(e is NoSuchMethodError);
Expect.stringEquals(e.stackTrace.toString(), s.toString());
}
}