mirror of
https://github.com/dart-lang/sdk
synced 2024-10-03 21:33:03 +00:00
3c7353d987
Support //# multitests for better dartfmt compatibility and fewer multitest false positives All files under tests were manually updated with find . -iregex '.*\.dart$' -print0 | xargs -0 perl -pi -e 's/(\S\s+)\/\/\/ /$1\/\/# /' For now both old and new styles are allowed to accommodate CO19 tests. R=efortuna@google.com Review-Url: https://codereview.chromium.org/2765693002 .
30 lines
618 B
Dart
30 lines
618 B
Dart
// Copyright (c) 2015, 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 "dart:async";
|
|
import "package:expect/expect.dart";
|
|
|
|
foo() async {
|
|
try {
|
|
try {
|
|
await for (var c in new Stream.fromIterable([])) {} // //# 01: ok
|
|
await 0; // //# 02: ok
|
|
} catch (error) {
|
|
}
|
|
} catch (error) {
|
|
}
|
|
throw "error";
|
|
}
|
|
|
|
main() async {
|
|
var error = "no error";
|
|
try {
|
|
await foo();
|
|
} catch (e) {
|
|
error = e;
|
|
}
|
|
Expect.equals("error", error);
|
|
}
|
|
|