| Index: tests/language/await_null_aware_test.dart
|
| diff --git a/tests/language/enum_index_test.dart b/tests/language/await_null_aware_test.dart
|
| similarity index 51%
|
| copy from tests/language/enum_index_test.dart
|
| copy to tests/language/await_null_aware_test.dart
|
| index 21a8e0e94442b2da9e6057547fb2b0be4d08b441..483d9dd396a9cf1e7a8f8e55fce969a605733c58 100644
|
| --- a/tests/language/enum_index_test.dart
|
| +++ b/tests/language/await_null_aware_test.dart
|
| @@ -2,31 +2,22 @@
|
| // 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.
|
|
|
| -// SharedOptions=--enable-enum
|
| -
|
| -// Test index access for enums.
|
| -
|
| -library enum_index_test;
|
| +// Regression test for issue dartbug.com/24392
|
|
|
| import 'package:expect/expect.dart';
|
| +import 'dart:async';
|
|
|
| -enum Enum {
|
| - A,
|
| - B,
|
| +Future<int> f() async {
|
| + // Unreachable.
|
| + Expect.isTrue(false);
|
| }
|
|
|
| -class Class {
|
| - var index;
|
| -}
|
| +main() async {
|
| + int x = 1;
|
| + x ??= await f();
|
| + Expect.equals(1, x);
|
|
|
| -main() {
|
| - test(null, new Class());
|
| - test(0, Enum.A);
|
| - test(1, Enum.B);
|
| + int y = 1;
|
| + y = y ?? await f();
|
| + Expect.equals(1, y);
|
| }
|
| -
|
| -test(expected, object) {
|
| - Expect.equals(expected, object.index);
|
| -}
|
| -
|
| -
|
|
|