mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 10:48:25 +00:00
Test for #48322
Change-Id: I878a288ac5932de8c83546df91038dcf54cd9039 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231845 Reviewed-by: Lasse Nielsen <lrn@google.com> Commit-Queue: Stephen Adams <sra@google.com>
This commit is contained in:
parent
3a3738c6fb
commit
53b730791a
18
tests/corelib/null_closurized_method_tostring_test.dart
Normal file
18
tests/corelib/null_closurized_method_tostring_test.dart
Normal file
|
@ -0,0 +1,18 @@
|
|||
// Copyright (c) 2022, 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";
|
||||
|
||||
// The closurized methods of `null` have working `toString()` methods.
|
||||
// See #48322.
|
||||
|
||||
void main() {
|
||||
check(null.toString);
|
||||
check(null.noSuchMethod);
|
||||
}
|
||||
|
||||
void check(Object o) {
|
||||
final s = o.toString();
|
||||
Expect.notEquals("", s);
|
||||
}
|
18
tests/corelib_2/null_closurized_method_tostring_test.dart
Normal file
18
tests/corelib_2/null_closurized_method_tostring_test.dart
Normal file
|
@ -0,0 +1,18 @@
|
|||
// Copyright (c) 2022, 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";
|
||||
|
||||
// The closurized methods of `null` have working `toString()` methods.
|
||||
// See #48322.
|
||||
|
||||
void main() {
|
||||
check(null.toString);
|
||||
check(null.noSuchMethod);
|
||||
}
|
||||
|
||||
void check(Object o) {
|
||||
final s = o.toString();
|
||||
Expect.notEquals("", s);
|
||||
}
|
Loading…
Reference in a new issue