dart-sdk/tests/web/bounded_type_literal_test.dart
Stephen Adams cb52932c72 [tests, dart2js] Fix test using minified type names
1. Add `Object` and `Map` to the very short list of names that are
unminified in the app.

2. Tweak test to avoid testing minified name.

Change-Id: Ide0cedc2950b5392eb6963403a48c0f89cd1b50a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332368
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-10-27 01:36:28 +00:00

27 lines
759 B
Dart

// Copyright (c) 2018, 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.
// dart2jsOptions=--strong
import 'package:expect/expect.dart';
class Foo<T extends num> {}
main() {
var a = new Foo();
var b = Foo;
Expect.equals(a.runtimeType, b);
var runtimeTypeToString = "${a.runtimeType}";
var typeLiteralToString = "${b}";
Expect.equals(runtimeTypeToString, typeLiteralToString);
if (!runtimeTypeToString.contains('minified:')) {
Expect.equals("Foo<num>", runtimeTypeToString);
Expect.equals("Foo<num>", typeLiteralToString);
}
print(runtimeTypeToString);
print(typeLiteralToString);
}