Add tests for bug #33660

Change-Id: I46ddc241ff4b9f33380f80ca641b27089ccbd736
Reviewed-on: https://dart-review.googlesource.com/63821
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This commit is contained in:
Jens Johansen 2018-07-09 11:38:17 +00:00 committed by commit-bot@chromium.org
parent ac05595889
commit 810cdf8649
51 changed files with 2532 additions and 0 deletions

View file

@ -0,0 +1,46 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10";
Node node = new Node('1', [
new Node('2', []),
await new Future.value(new Node('3', [
await new Future.value(new Node('4', [
new Node('5', [
await new Future.value(new Node('6', [
await new Future.value(new Node('7', [])),
])),
await new Future.value(new Node('8', [])),
await new Future.value(new Node('9', [])),
]),
])),
])),
await new Future.value(new Node('10', [])),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,26 @@
library;
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
class Node extends core::Object {
final field core::List<self::Node> nested;
final field core::String name;
constructor •(core::String name, [core::List<self::Node> nested = null]) → void
: self::Node::name = name, self::Node::nested = nested, super core::Object::•() {}
method toString() → core::String
return "<${this.{self::Node::name}}:[${let final dynamic #t1 = this.{self::Node::nested} in #t1.==(null) ? null : #t1.join(", ")}]>";
method toSimpleString() → dynamic {
dynamic tmp = let final dynamic #t2 = this.{self::Node::nested} in #t2.==(null) ? null : #t2.map((dynamic child) → dynamic => child.toSimpleString());
return "${this.{self::Node::name}} ${let final dynamic #t3 = tmp in #t3.==(null) ? null : #t3.join(" ")}".trim();
}
}
static method main() → void async {
core::String expected = "1 2 3 4 5 6 7 8 9 10";
self::Node node = new self::Node::•("1", <dynamic>[new self::Node::•("2", <dynamic>[]), await asy::Future::value<dynamic>(new self::Node::•("3", <dynamic>[await asy::Future::value<dynamic>(new self::Node::•("4", <dynamic>[new self::Node::•("5", <dynamic>[await asy::Future::value<dynamic>(new self::Node::•("6", <dynamic>[await asy::Future::value<dynamic>(new self::Node::•("7", <dynamic>[]))])), await asy::Future::value<dynamic>(new self::Node::•("8", <dynamic>[])), await asy::Future::value<dynamic>(new self::Node::•("9", <dynamic>[]))])]))])), await asy::Future::value<dynamic>(new self::Node::•("10", <dynamic>[]))]);
core::String actual = node.toSimpleString();
core::print(actual);
if(!actual.==(expected)) {
throw "Expected '${expected}' but got '${actual}'";
}
}

View file

@ -0,0 +1,63 @@
library;
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
class Node extends core::Object {
final field core::List<self::Node> nested;
final field core::String name;
constructor •(core::String name, [core::List<self::Node> nested = null]) → void
: self::Node::name = name, self::Node::nested = nested, super core::Object::•() {}
method toString() → core::String
return "<${this.{self::Node::name}}:[${let final dynamic #t1 = this.{self::Node::nested} in #t1.==(null) ? null : #t1.join(", ")}]>";
method toSimpleString() → dynamic {
dynamic tmp = let final dynamic #t2 = this.{self::Node::nested} in #t2.==(null) ? null : #t2.map((dynamic child) → dynamic => child.toSimpleString());
return "${this.{self::Node::name}} ${let final dynamic #t3 = tmp in #t3.==(null) ? null : #t3.join(" ")}".trim();
}
}
static method main() → void /* originally async */ {
final asy::Completer<dynamic> :async_completer = asy::Completer::sync<dynamic>();
asy::FutureOr<dynamic> :return_value;
dynamic :async_stack_trace;
dynamic :async_op_then;
dynamic :async_op_error;
dynamic :await_jump_var = 0;
dynamic :await_ctx_var;
dynamic :saved_try_context_var0;
dynamic :async_temporary_0;
dynamic :async_temporary_1;
function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding
try {
#L1:
{
core::String expected = "1 2 3 4 5 6 7 8 9 10";
:async_temporary_1 = new self::Node::•("2", <dynamic>[]);
[yield] let dynamic #t4 = asy::_awaitHelper(asy::Future::value<dynamic>(new self::Node::•("7", <dynamic>[])), :async_op_then, :async_op_error, :async_op) in null;
[yield] let dynamic #t5 = asy::_awaitHelper(asy::Future::value<dynamic>(new self::Node::•("6", <dynamic>[:result])), :async_op_then, :async_op_error, :async_op) in null;
:async_temporary_1 = :result;
[yield] let dynamic #t6 = asy::_awaitHelper(asy::Future::value<dynamic>(new self::Node::•("8", <dynamic>[])), :async_op_then, :async_op_error, :async_op) in null;
:async_temporary_0 = :result;
[yield] let dynamic #t7 = asy::_awaitHelper(asy::Future::value<dynamic>(new self::Node::•("9", <dynamic>[])), :async_op_then, :async_op_error, :async_op) in null;
[yield] let dynamic #t8 = asy::_awaitHelper(asy::Future::value<dynamic>(new self::Node::•("4", <dynamic>[new self::Node::•("5", <dynamic>[:async_temporary_1, :async_temporary_0, :result])])), :async_op_then, :async_op_error, :async_op) in null;
[yield] let dynamic #t9 = asy::_awaitHelper(asy::Future::value<dynamic>(new self::Node::•("3", <dynamic>[:result])), :async_op_then, :async_op_error, :async_op) in null;
:async_temporary_0 = :result;
[yield] let dynamic #t10 = asy::_awaitHelper(asy::Future::value<dynamic>(new self::Node::•("10", <dynamic>[])), :async_op_then, :async_op_error, :async_op) in null;
self::Node node = new self::Node::•("1", <dynamic>[:async_temporary_1, :async_temporary_0, :result]);
core::String actual = node.toSimpleString();
core::print(actual);
if(!actual.==(expected)) {
throw "Expected '${expected}' but got '${actual}'";
}
}
asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
:async_completer.{asy::Completer::completeError}(:exception, :stack_trace);
}
:async_stack_trace = asy::_asyncStackTraceHelper(:async_op);
:async_op_then = asy::_asyncThenWrapperHelper(:async_op);
:async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
asy::Future::microtask<dynamic>(:async_op);
return :async_completer.{asy::Completer::future};
}

View file

@ -0,0 +1,16 @@
library;
import self as self;
import "dart:core" as core;
class Node extends core::Object {
final field core::List<self::Node> nested;
final field core::String name;
constructor •(core::String name, [core::List<self::Node> nested]) → void
;
method toString() → core::String
;
method toSimpleString() → dynamic
;
}
static method main() → void
;

View file

@ -0,0 +1,26 @@
library;
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
class Node extends core::Object {
final field core::List<self::Node> nested;
final field core::String name;
constructor •(core::String name, [core::List<self::Node> nested = null]) → void
: self::Node::name = name, self::Node::nested = nested, super core::Object::•() {}
method toString() → core::String
return "<${this.{self::Node::name}}:[${let final core::List<self::Node> #t1 = this.{self::Node::nested} in #t1.==(null) ?{core::String} null : #t1.{core::Iterable::join}(", ")}]>";
method toSimpleString() → dynamic {
core::Iterable<dynamic> tmp = let final core::List<self::Node> #t2 = this.{self::Node::nested} in #t2.==(null) ?{core::Iterable<dynamic>} null : #t2.{core::Iterable::map}<dynamic>((self::Node child) → dynamic => child.{self::Node::toSimpleString}());
return "${this.{self::Node::name}} ${let final core::Iterable<dynamic> #t3 = tmp in #t3.==(null) ?{core::String} null : #t3.{core::Iterable::join}(" ")}".{core::String::trim}();
}
}
static method main() → void async {
core::String expected = "1 2 3 4 5 6 7 8 9 10";
self::Node node = new self::Node::•("1", <self::Node>[new self::Node::•("2", <self::Node>[]), await asy::Future::value<self::Node>(new self::Node::•("3", <self::Node>[await asy::Future::value<self::Node>(new self::Node::•("4", <self::Node>[new self::Node::•("5", <self::Node>[await asy::Future::value<self::Node>(new self::Node::•("6", <self::Node>[await asy::Future::value<self::Node>(new self::Node::•("7", <self::Node>[]))])), await asy::Future::value<self::Node>(new self::Node::•("8", <self::Node>[])), await asy::Future::value<self::Node>(new self::Node::•("9", <self::Node>[]))])]))])), await asy::Future::value<self::Node>(new self::Node::•("10", <self::Node>[]))]);
core::String actual = node.{self::Node::toSimpleString}() as{TypeError} core::String;
core::print(actual);
if(!actual.{core::String::==}(expected)) {
throw "Expected '${expected}' but got '${actual}'";
}
}

View file

@ -0,0 +1,63 @@
library;
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
class Node extends core::Object {
final field core::List<self::Node> nested;
final field core::String name;
constructor •(core::String name, [core::List<self::Node> nested = null]) → void
: self::Node::name = name, self::Node::nested = nested, super core::Object::•() {}
method toString() → core::String
return "<${this.{self::Node::name}}:[${let final core::List<self::Node> #t1 = this.{self::Node::nested} in #t1.==(null) ?{core::String} null : #t1.{core::Iterable::join}(", ")}]>";
method toSimpleString() → dynamic {
core::Iterable<dynamic> tmp = let final core::List<self::Node> #t2 = this.{self::Node::nested} in #t2.==(null) ?{core::Iterable<dynamic>} null : #t2.{core::Iterable::map}<dynamic>((self::Node child) → dynamic => child.{self::Node::toSimpleString}());
return "${this.{self::Node::name}} ${let final core::Iterable<dynamic> #t3 = tmp in #t3.==(null) ?{core::String} null : #t3.{core::Iterable::join}(" ")}".{core::String::trim}();
}
}
static method main() → void /* originally async */ {
final asy::Completer<dynamic> :async_completer = asy::Completer::sync<dynamic>();
asy::FutureOr<dynamic> :return_value;
dynamic :async_stack_trace;
dynamic :async_op_then;
dynamic :async_op_error;
dynamic :await_jump_var = 0;
dynamic :await_ctx_var;
dynamic :saved_try_context_var0;
dynamic :async_temporary_0;
dynamic :async_temporary_1;
function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding
try {
#L1:
{
core::String expected = "1 2 3 4 5 6 7 8 9 10";
:async_temporary_1 = new self::Node::•("2", <self::Node>[]);
[yield] let dynamic #t4 = asy::_awaitHelper(asy::Future::value<self::Node>(new self::Node::•("7", <self::Node>[])), :async_op_then, :async_op_error, :async_op) in null;
[yield] let dynamic #t5 = asy::_awaitHelper(asy::Future::value<self::Node>(new self::Node::•("6", <self::Node>[:result])), :async_op_then, :async_op_error, :async_op) in null;
:async_temporary_1 = :result;
[yield] let dynamic #t6 = asy::_awaitHelper(asy::Future::value<self::Node>(new self::Node::•("8", <self::Node>[])), :async_op_then, :async_op_error, :async_op) in null;
:async_temporary_0 = :result;
[yield] let dynamic #t7 = asy::_awaitHelper(asy::Future::value<self::Node>(new self::Node::•("9", <self::Node>[])), :async_op_then, :async_op_error, :async_op) in null;
[yield] let dynamic #t8 = asy::_awaitHelper(asy::Future::value<self::Node>(new self::Node::•("4", <self::Node>[new self::Node::•("5", <self::Node>[:async_temporary_1, :async_temporary_0, :result])])), :async_op_then, :async_op_error, :async_op) in null;
[yield] let dynamic #t9 = asy::_awaitHelper(asy::Future::value<self::Node>(new self::Node::•("3", <self::Node>[:result])), :async_op_then, :async_op_error, :async_op) in null;
:async_temporary_0 = :result;
[yield] let dynamic #t10 = asy::_awaitHelper(asy::Future::value<self::Node>(new self::Node::•("10", <self::Node>[])), :async_op_then, :async_op_error, :async_op) in null;
self::Node node = new self::Node::•("1", <self::Node>[:async_temporary_1, :async_temporary_0, :result]);
core::String actual = node.{self::Node::toSimpleString}() as{TypeError} core::String;
core::print(actual);
if(!actual.{core::String::==}(expected)) {
throw "Expected '${expected}' but got '${actual}'";
}
}
asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
:async_completer.{asy::Completer::completeError}(:exception, :stack_trace);
}
:async_stack_trace = asy::_asyncStackTraceHelper(:async_op);
:async_op_then = asy::_asyncThenWrapperHelper(:async_op);
:async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
asy::Future::microtask<dynamic>(:async_op);
return :async_completer.{asy::Completer::future};
}

View file

@ -6,6 +6,8 @@
# testing generating Kernel ASTs directly, that is, code in
# pkg/fasta/lib/src/kernel/.
async_nested: RuntimeError # Issue 33660
rasta/unsupported_platform_library: RuntimeError # OK, this must report an error at runtime.
DeltaBlue: Fail # Fasta and dartk disagree on static initializers

View file

@ -6,6 +6,8 @@
# Kernel ASTs directly, that is, code in pkg/fasta/lib/src/kernel/ with
# strong-mode enabled.
async_nested: RuntimeError # Issue 33660
DeltaBlue: Fail
accessors: Fail
argument_mismatch: Fail # Test assumes Dart 1.0 semantics

View file

@ -0,0 +1,46 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10";
Node node = new Node('1', [
new Node('2', []),
await new Future.value(new Node('3', [
await new Future.value(new Node('4', [
new Node('5', [
await new Future.value(new Node('6', [
await new Future.value(new Node('7', [])),
])),
await new Future.value(new Node('8', [])),
await new Future.value(new Node('9', [])),
]),
])),
])),
await new Future.value(new Node('10', [])),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,46 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11";
Node node = new Node('1', [
new Node('2', [
new Node('3', []),
]),
await new Future.value(new Node('4', [
await new Future.value(new Node('5', [])),
new Node('6', [
new Node('7', []),
await new Future.value(new Node('8', [])),
]),
await new Future.value(new Node('9', [])),
])),
await new Future.value(new Node('10', [])),
new Node('11', []),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,48 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12";
Node node = new Node('1', [
new Node('2', [
await new Future.value(new Node('3', [])),
await new Future.value(new Node('4', [
new Node('5', []),
await new Future.value(new Node('6', [])),
await new Future.value(new Node('7', [])),
new Node('8', []),
])),
new Node('9', []),
new Node('10', [
new Node('11', [
await new Future.value(new Node('12', [])),
]),
]),
]),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,46 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12";
Node node = await new Future.value(new Node('1', [
await new Future.value(new Node('2', [])),
await new Future.value(new Node('3', [])),
await new Future.value(new Node('4', [
await new Future.value(new Node('5', [])),
new Node('6', []),
new Node('7', [
new Node('8', []),
await new Future.value(new Node('9', [])),
]),
await new Future.value(new Node('10', [])),
])),
new Node('11', []),
await new Future.value(new Node('12', [])),
]));
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,46 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12";
Node node = await new Future.value(new Node('1', [
await new Future.value(new Node('2', [])),
await new Future.value(new Node('3', [
await new Future.value(new Node('4', [])),
await new Future.value(new Node('5', [])),
await new Future.value(new Node('6', [])),
])),
new Node('7', []),
new Node('8', [
new Node('9', []),
await new Future.value(new Node('10', [])),
new Node('11', []),
await new Future.value(new Node('12', [])),
]),
]));
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,49 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12";
Node node = new Node('1', [
new Node('2', [
await new Future.value(new Node('3', [
new Node('4', []),
])),
new Node('5', [
await new Future.value(new Node('6', [
await new Future.value(new Node('7', [
new Node('8', []),
])),
new Node('9', []),
await new Future.value(new Node('10', [])),
])),
await new Future.value(new Node('11', [])),
await new Future.value(new Node('12', [])),
]),
]),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,48 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12";
Node node = await new Future.value(new Node('1', [
await new Future.value(new Node('2', [])),
await new Future.value(new Node('3', [
new Node('4', []),
new Node('5', []),
await new Future.value(new Node('6', [])),
new Node('7', [
await new Future.value(new Node('8', [
new Node('9', []),
])),
await new Future.value(new Node('10', [])),
]),
])),
new Node('11', [
await new Future.value(new Node('12', [])),
]),
]));
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,48 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13";
Node node = await new Future.value(new Node('1', [
await new Future.value(new Node('2', [
await new Future.value(new Node('3', [])),
])),
await new Future.value(new Node('4', [
await new Future.value(new Node('5', [])),
await new Future.value(new Node('6', [])),
new Node('7', []),
new Node('8', []),
new Node('9', [
await new Future.value(new Node('10', [])),
]),
new Node('11', []),
new Node('12', []),
])),
await new Future.value(new Node('13', [])),
]));
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,49 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13";
Node node = new Node('1', [
new Node('2', [
await new Future.value(new Node('3', [])),
await new Future.value(new Node('4', [
new Node('5', []),
new Node('6', []),
new Node('7', []),
new Node('8', []),
await new Future.value(new Node('9', [
new Node('10', [
new Node('11', []),
]),
])),
await new Future.value(new Node('12', [])),
])),
await new Future.value(new Node('13', [])),
]),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,51 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13";
Node node = new Node('1', [
await new Future.value(new Node('2', [
new Node('3', []),
await new Future.value(new Node('4', [
await new Future.value(new Node('5', [
new Node('6', []),
new Node('7', [
new Node('8', []),
]),
await new Future.value(new Node('9', [])),
new Node('10', [
new Node('11', []),
]),
])),
])),
await new Future.value(new Node('12', [
new Node('13', []),
])),
])),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,50 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13";
Node node = await new Future.value(new Node('1', [
await new Future.value(new Node('2', [
new Node('3', []),
new Node('4', [
new Node('5', []),
new Node('6', []),
await new Future.value(new Node('7', [
new Node('8', [
new Node('9', []),
]),
new Node('10', []),
new Node('11', [
await new Future.value(new Node('12', [])),
]),
])),
await new Future.value(new Node('13', [])),
]),
])),
]));
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,49 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13";
Node node = new Node('1', [
await new Future.value(new Node('2', [])),
await new Future.value(new Node('3', [])),
new Node('4', [
await new Future.value(new Node('5', [
new Node('6', []),
new Node('7', []),
await new Future.value(new Node('8', [
new Node('9', []),
])),
])),
new Node('10', [
new Node('11', []),
await new Future.value(new Node('12', [])),
]),
]),
await new Future.value(new Node('13', [])),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,52 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14";
Node node = new Node('1', [
new Node('2', []),
await new Future.value(new Node('3', [])),
await new Future.value(new Node('4', [
new Node('5', [
await new Future.value(new Node('6', [
new Node('7', [
new Node('8', [
new Node('9', []),
new Node('10', []),
await new Future.value(new Node('11', [])),
]),
await new Future.value(new Node('12', [])),
]),
])),
await new Future.value(new Node('13', [
new Node('14', []),
])),
]),
])),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,50 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14";
Node node = new Node('1', [
new Node('2', []),
await new Future.value(new Node('3', [
new Node('4', [
await new Future.value(new Node('5', [])),
new Node('6', []),
new Node('7', []),
new Node('8', [
await new Future.value(new Node('9', [
new Node('10', []),
await new Future.value(new Node('11', [])),
])),
]),
await new Future.value(new Node('12', [])),
]),
new Node('13', []),
])),
await new Future.value(new Node('14', [])),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,52 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14";
Node node = new Node('1', [
await new Future.value(new Node('2', [
await new Future.value(new Node('3', [
new Node('4', []),
await new Future.value(new Node('5', [
await new Future.value(new Node('6', [])),
new Node('7', [
new Node('8', []),
await new Future.value(new Node('9', [])),
new Node('10', []),
new Node('11', [
new Node('12', []),
]),
]),
])),
new Node('13', [
await new Future.value(new Node('14', [])),
]),
])),
])),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,51 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14";
Node node = await new Future.value(new Node('1', [
new Node('2', []),
await new Future.value(new Node('3', [
new Node('4', []),
new Node('5', []),
new Node('6', []),
new Node('7', []),
new Node('8', [
await new Future.value(new Node('9', [
await new Future.value(new Node('10', [])),
])),
]),
new Node('11', []),
])),
new Node('12', [
new Node('13', [
await new Future.value(new Node('14', [])),
]),
]),
]));
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,49 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14";
Node node = await new Future.value(new Node('1', [
new Node('2', []),
await new Future.value(new Node('3', [
new Node('4', [
await new Future.value(new Node('5', [])),
new Node('6', []),
new Node('7', []),
]),
await new Future.value(new Node('8', [])),
new Node('9', [
new Node('10', []),
await new Future.value(new Node('11', [])),
]),
await new Future.value(new Node('12', [])),
])),
await new Future.value(new Node('13', [])),
new Node('14', []),
]));
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,53 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15";
Node node = new Node('1', [
new Node('2', []),
new Node('3', [
await new Future.value(new Node('4', [])),
new Node('5', [
new Node('6', [
new Node('7', [
await new Future.value(new Node('8', [
new Node('9', []),
new Node('10', []),
await new Future.value(new Node('11', [])),
await new Future.value(new Node('12', [])),
new Node('13', []),
])),
await new Future.value(new Node('14', [
new Node('15', []),
])),
]),
]),
]),
]),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,53 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15";
Node node = await new Future.value(new Node('1', [
new Node('2', []),
new Node('3', []),
new Node('4', [
new Node('5', []),
]),
new Node('6', [
new Node('7', []),
]),
new Node('8', [
new Node('9', [
await new Future.value(new Node('10', [
new Node('11', [
new Node('12', []),
new Node('13', []),
await new Future.value(new Node('14', [])),
]),
])),
await new Future.value(new Node('15', [])),
]),
]),
]));
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,53 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15";
Node node = await new Future.value(new Node('1', [
await new Future.value(new Node('2', [
new Node('3', []),
await new Future.value(new Node('4', [
await new Future.value(new Node('5', [
new Node('6', []),
new Node('7', [
await new Future.value(new Node('8', [
new Node('9', []),
])),
new Node('10', []),
new Node('11', []),
new Node('12', [
await new Future.value(new Node('13', [])),
new Node('14', []),
]),
]),
])),
await new Future.value(new Node('15', [])),
])),
])),
]));
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,54 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15";
Node node = await new Future.value(new Node('1', [
await new Future.value(new Node('2', [
new Node('3', [
new Node('4', [
await new Future.value(new Node('5', [])),
new Node('6', [
await new Future.value(new Node('7', [
new Node('8', [
await new Future.value(new Node('9', [])),
new Node('10', []),
]),
new Node('11', []),
await new Future.value(new Node('12', [])),
new Node('13', []),
])),
new Node('14', [
await new Future.value(new Node('15', [])),
]),
]),
]),
]),
])),
]));
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,52 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15";
Node node = new Node('1', [
await new Future.value(new Node('2', [])),
new Node('3', []),
await new Future.value(new Node('4', [
await new Future.value(new Node('5', [])),
new Node('6', [
new Node('7', [
new Node('8', [
new Node('9', []),
]),
]),
await new Future.value(new Node('10', [
new Node('11', []),
])),
await new Future.value(new Node('12', [])),
]),
new Node('13', []),
])),
await new Future.value(new Node('14', [])),
new Node('15', []),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,51 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15";
Node node = new Node('1', [
await new Future.value(new Node('2', [])),
await new Future.value(new Node('3', [
new Node('4', [
new Node('5', [
new Node('6', []),
new Node('7', [
new Node('8', []),
]),
new Node('9', []),
await new Future.value(new Node('10', [])),
new Node('11', []),
]),
]),
new Node('12', []),
await new Future.value(new Node('13', [])),
])),
await new Future.value(new Node('14', [])),
new Node('15', []),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,50 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15";
Node node = await new Future.value(new Node('1', [
new Node('2', []),
new Node('3', []),
await new Future.value(new Node('4', [
await new Future.value(new Node('5', [])),
new Node('6', []),
await new Future.value(new Node('7', [])),
await new Future.value(new Node('8', [])),
])),
new Node('9', []),
new Node('10', [
await new Future.value(new Node('11', [])),
new Node('12', [
await new Future.value(new Node('13', [])),
new Node('14', []),
await new Future.value(new Node('15', [])),
]),
]),
]));
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,53 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15";
Node node = new Node('1', [
new Node('2', [
new Node('3', [
new Node('4', []),
await new Future.value(new Node('5', [
await new Future.value(new Node('6', [
new Node('7', [
await new Future.value(new Node('8', [])),
new Node('9', []),
await new Future.value(new Node('10', [])),
await new Future.value(new Node('11', [])),
new Node('12', [
await new Future.value(new Node('13', [])),
]),
new Node('14', []),
]),
])),
await new Future.value(new Node('15', [])),
])),
]),
]),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,50 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14";
Node node = new Node('1', [
new Node('2', [
await new Future.value(new Node('3', [])),
]),
await new Future.value(new Node('4', [
await new Future.value(new Node('5', [
new Node('6', [
new Node('7', []),
]),
new Node('8', []),
await new Future.value(new Node('9', [])),
new Node('10', []),
new Node('11', []),
])),
await new Future.value(new Node('12', [])),
new Node('13', []),
new Node('14', []),
])),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,53 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16";
Node node = new Node('1', [
new Node('2', []),
await new Future.value(new Node('3', [
new Node('4', []),
await new Future.value(new Node('5', [
new Node('6', []),
await new Future.value(new Node('7', [
new Node('8', []),
])),
])),
])),
await new Future.value(new Node('9', [
new Node('10', [
new Node('11', []),
new Node('12', []),
await new Future.value(new Node('13', [])),
await new Future.value(new Node('14', [])),
await new Future.value(new Node('15', [])),
new Node('16', []),
]),
])),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,54 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16";
Node node = new Node('1', [
await new Future.value(new Node('2', [
new Node('3', []),
new Node('4', []),
new Node('5', [
new Node('6', []),
await new Future.value(new Node('7', [
new Node('8', [
new Node('9', []),
new Node('10', [
new Node('11', [
new Node('12', []),
new Node('13', []),
await new Future.value(new Node('14', [])),
]),
]),
]),
])),
new Node('15', []),
await new Future.value(new Node('16', [])),
]),
])),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,55 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16";
Node node = new Node('1', [
await new Future.value(new Node('2', [
new Node('3', []),
await new Future.value(new Node('4', [])),
new Node('5', [
new Node('6', []),
await new Future.value(new Node('7', [
new Node('8', [
await new Future.value(new Node('9', [])),
await new Future.value(new Node('10', [
new Node('11', [
new Node('12', [
await new Future.value(new Node('13', [])),
]),
new Node('14', []),
await new Future.value(new Node('15', [])),
]),
])),
await new Future.value(new Node('16', [])),
]),
])),
]),
])),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,54 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16";
Node node = new Node('1', [
new Node('2', [
new Node('3', []),
new Node('4', []),
new Node('5', [
await new Future.value(new Node('6', [
new Node('7', []),
new Node('8', [
await new Future.value(new Node('9', [])),
await new Future.value(new Node('10', [])),
await new Future.value(new Node('11', [])),
]),
await new Future.value(new Node('12', [])),
new Node('13', []),
])),
new Node('14', [
await new Future.value(new Node('15', [
new Node('16', []),
])),
]),
]),
]),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,53 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16";
Node node = new Node('1', [
await new Future.value(new Node('2', [])),
await new Future.value(new Node('3', [
new Node('4', [
new Node('5', []),
new Node('6', []),
await new Future.value(new Node('7', [])),
await new Future.value(new Node('8', [
new Node('9', []),
])),
new Node('10', [
new Node('11', [
new Node('12', []),
]),
]),
]),
])),
await new Future.value(new Node('13', [])),
await new Future.value(new Node('14', [])),
new Node('15', []),
await new Future.value(new Node('16', [])),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,54 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16";
Node node = new Node('1', [
new Node('2', [
new Node('3', []),
new Node('4', []),
await new Future.value(new Node('5', [
await new Future.value(new Node('6', [
await new Future.value(new Node('7', [])),
new Node('8', [
new Node('9', []),
await new Future.value(new Node('10', [])),
]),
])),
])),
await new Future.value(new Node('11', [])),
new Node('12', [
new Node('13', []),
await new Future.value(new Node('14', [
await new Future.value(new Node('15', [])),
])),
new Node('16', []),
]),
]),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,55 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16";
Node node = new Node('1', [
new Node('2', []),
new Node('3', [
await new Future.value(new Node('4', [])),
new Node('5', [
new Node('6', [
new Node('7', [
await new Future.value(new Node('8', [])),
await new Future.value(new Node('9', [
await new Future.value(new Node('10', [
new Node('11', []),
])),
await new Future.value(new Node('12', [])),
await new Future.value(new Node('13', [
await new Future.value(new Node('14', [])),
])),
])),
await new Future.value(new Node('15', [])),
new Node('16', []),
]),
]),
]),
]),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,54 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16";
Node node = await new Future.value(new Node('1', [
await new Future.value(new Node('2', [
new Node('3', []),
new Node('4', []),
new Node('5', [
await new Future.value(new Node('6', [
new Node('7', [
new Node('8', []),
new Node('9', [
new Node('10', []),
await new Future.value(new Node('11', [])),
]),
]),
await new Future.value(new Node('12', [])),
])),
new Node('13', [
await new Future.value(new Node('14', [])),
await new Future.value(new Node('15', [])),
new Node('16', []),
]),
]),
])),
]));
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,54 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16";
Node node = await new Future.value(new Node('1', [
new Node('2', []),
await new Future.value(new Node('3', [
await new Future.value(new Node('4', [])),
await new Future.value(new Node('5', [
new Node('6', []),
new Node('7', []),
await new Future.value(new Node('8', [])),
await new Future.value(new Node('9', [])),
])),
new Node('10', [
new Node('11', [
new Node('12', [
new Node('13', []),
]),
]),
new Node('14', [
await new Future.value(new Node('15', [])),
]),
new Node('16', []),
]),
])),
]));
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,52 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15";
Node node = await new Future.value(new Node('1', [
await new Future.value(new Node('2', [
await new Future.value(new Node('3', [])),
new Node('4', []),
await new Future.value(new Node('5', [
new Node('6', [
new Node('7', []),
await new Future.value(new Node('8', [])),
]),
new Node('9', []),
await new Future.value(new Node('10', [])),
])),
new Node('11', [
new Node('12', []),
]),
new Node('13', [
await new Future.value(new Node('14', [])),
]),
])),
await new Future.value(new Node('15', [])),
]));
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,53 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16";
Node node = new Node('1', [
new Node('2', []),
await new Future.value(new Node('3', [])),
new Node('4', [
new Node('5', [
new Node('6', []),
new Node('7', []),
]),
]),
await new Future.value(new Node('8', [
await new Future.value(new Node('9', [])),
await new Future.value(new Node('10', [
new Node('11', []),
new Node('12', []),
await new Future.value(new Node('13', [])),
])),
])),
await new Future.value(new Node('14', [])),
new Node('15', [
new Node('16', []),
]),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,52 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16";
Node node = await new Future.value(new Node('1', [
new Node('2', []),
new Node('3', [
new Node('4', []),
]),
new Node('5', []),
new Node('6', []),
await new Future.value(new Node('7', [])),
await new Future.value(new Node('8', [
await new Future.value(new Node('9', [])),
new Node('10', [
new Node('11', []),
await new Future.value(new Node('12', [])),
]),
])),
new Node('13', [
new Node('14', []),
]),
await new Future.value(new Node('15', [])),
await new Future.value(new Node('16', [])),
]));
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,43 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9";
Node node = await new Future.value(new Node('1', [
new Node('2', []),
await new Future.value(new Node('3', [
new Node('4', []),
new Node('5', []),
await new Future.value(new Node('6', [
new Node('7', []),
])),
])),
new Node('8', []),
await new Future.value(new Node('9', [])),
]));
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,44 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9";
Node node = await new Future.value(new Node('1', [
new Node('2', [
new Node('3', [
new Node('4', []),
]),
]),
await new Future.value(new Node('5', [
new Node('6', []),
new Node('7', []),
await new Future.value(new Node('8', [])),
])),
await new Future.value(new Node('9', [])),
]));
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -0,0 +1,43 @@
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
String expected = "1 2 3 4 5 6 7 8 9";
Node node = new Node('1', [
await new Future.value(new Node('2', [])),
await new Future.value(new Node('3', [
new Node('4', []),
await new Future.value(new Node('5', [
new Node('6', []),
])),
await new Future.value(new Node('7', [])),
new Node('8', []),
])),
await new Future.value(new Node('9', [])),
]);
String actual = node.toSimpleString();
print(actual);
if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}

View file

@ -697,6 +697,47 @@ type_error_test: RuntimeError # Issue 31402 (Variable declaration)
# ===== dartk + vm status lines =====
[ $compiler == dartk && $runtime == vm && $strong ]
arithmetic2_test: RuntimeError # Throws CastError instead of TypeError
async_nested_01_test: RuntimeError # Issue 33660
async_nested_02_test: RuntimeError # Issue 33660
async_nested_03_test: RuntimeError # Issue 33660
async_nested_04_test: RuntimeError # Issue 33660
async_nested_05_test: RuntimeError # Issue 33660
async_nested_06_test: RuntimeError # Issue 33660
async_nested_07_test: RuntimeError # Issue 33660
async_nested_08_test: RuntimeError # Issue 33660
async_nested_09_test: RuntimeError # Issue 33660
async_nested_10_test: RuntimeError # Issue 33660
async_nested_11_test: RuntimeError # Issue 33660
async_nested_12_test: RuntimeError # Issue 33660
async_nested_13_test: RuntimeError # Issue 33660
async_nested_14_test: RuntimeError # Issue 33660
async_nested_15_test: RuntimeError # Issue 33660
async_nested_16_test: RuntimeError # Issue 33660
async_nested_17_test: RuntimeError # Issue 33660
async_nested_18_test: RuntimeError # Issue 33660
async_nested_19_test: RuntimeError # Issue 33660
async_nested_20_test: RuntimeError # Issue 33660
async_nested_21_test: RuntimeError # Issue 33660
async_nested_22_test: RuntimeError # Issue 33660
async_nested_23_test: RuntimeError # Issue 33660
async_nested_24_test: RuntimeError # Issue 33660
async_nested_25_test: RuntimeError # Issue 33660
async_nested_26_test: RuntimeError # Issue 33660
async_nested_27_test: RuntimeError # Issue 33660
async_nested_28_test: RuntimeError # Issue 33660
async_nested_29_test: RuntimeError # Issue 33660
async_nested_30_test: RuntimeError # Issue 33660
async_nested_31_test: RuntimeError # Issue 33660
async_nested_32_test: RuntimeError # Issue 33660
async_nested_33_test: RuntimeError # Issue 33660
async_nested_34_test: RuntimeError # Issue 33660
async_nested_35_test: RuntimeError # Issue 33660
async_nested_36_test: RuntimeError # Issue 33660
async_nested_37_test: RuntimeError # Issue 33660
async_nested_38_test: RuntimeError # Issue 33660
async_nested_39_test: RuntimeError # Issue 33660
async_nested_40_test: RuntimeError # Issue 33660
async_nested_41_test: RuntimeError # Issue 33660
async_star_cancel_while_paused_test: RuntimeError
async_star_pause_test: Fail, OK
async_star_test/02: RuntimeError # Issue 31402 (Invocation arguments)

View file

@ -0,0 +1,175 @@
// 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.
// See http://dartbug.com/33660 for details about what inspired this generator.
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'dart:math';
Random random = new Random();
int totalNodes = 0;
Set<String> seen = new Set<String>();
main(List<String> args) async {
int maxSize;
if (args.length > 0) maxSize = int.tryParse(args[0]);
maxSize ??= 5;
for (int i = 0; i < 2500; i++) {
stdout.write(".");
if (i % 75 == 74) stdout.write("\n");
totalNodes = 0;
Tree tree = fuzz(1 + random.nextInt(5), 1 + random.nextInt(8), maxSize);
String expected =
new List<String>.generate(totalNodes, (i) => "${i + 1}").join(" ");
String asyncProgram = printProgram(tree, true, false, true, '"$expected"');
if (seen.add(asyncProgram)) {
File asyncFile = new File('${maxSize}_${i}.dart')
..writeAsStringSync(asyncProgram);
List<String> run = await executeAndGetStdOut(
Platform.executable, <String>[asyncFile.path]);
if (expected == run[0]) {
asyncFile.deleteSync();
} else {
print("\n${asyncFile.path} was not as expected!");
String name = "async_nested_${maxSize}_${i}_test.dart";
asyncFile.renameSync(name);
print(" -> Created $name");
print(" (you might want to run dartfmt -w $name).");
}
}
}
print(" done ");
}
Tree fuzz(int asyncLikely, int childrenLikely, int maxSize) {
// asyncLikely = 3;
// childrenLikely = 5;
totalNodes++;
Tree result = new Tree();
result.name = "$totalNodes";
result.async = random.nextInt(10) < asyncLikely;
while (random.nextInt(10) < childrenLikely) {
if (totalNodes >= maxSize) return result;
result.children
.add(fuzz(1 + random.nextInt(5), 1 + random.nextInt(8), maxSize));
}
return result;
}
String printProgram(Tree tree, bool emitAsync, bool emitPrintOnCreate,
bool printSimple, String expected) {
StringBuffer lines = new StringBuffer();
lines.write("""
// 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.
// This has been automatically generated by script
// "async_nested_test_generator.dart".
import 'dart:async';
void main() async {
""");
printNode(Tree node) {
if (node.async && emitAsync) {
lines.write("await new Future.value(");
}
lines.writeln("new Node('${node.name}', [");
for (Tree child in node.children) {
printNode(child);
lines.write(",");
}
lines.writeln("])");
if (node.async && emitAsync) {
lines.write(")");
}
}
if (expected != null) {
lines.writeln('String expected = $expected;');
}
lines.write("Node node = ");
printNode(tree);
lines.writeln(";");
if (printSimple) {
lines.writeln("String actual = node.toSimpleString();");
} else {
lines.writeln("String actual = node.toString();");
}
lines.writeln("print(actual);");
if (expected != null) {
lines.writeln(r"""if (actual != expected) {
throw "Expected '$expected' but got '$actual'";
}""");
}
lines.writeln(r"""
}
class Node {
final List<Node> nested;
final String name;
Node(this.name, [this.nested]) {
""");
if (emitPrintOnCreate) {
lines.writeln(r'print("Creating $name");');
}
lines.write(r"""
}
String toString() => '<$name:[${nested?.join(', ')}]>';
toSimpleString() {
var tmp = nested?.map((child) => child.toSimpleString());
return '$name ${tmp?.join(' ')}'.trim();
}
}
""");
return lines.toString();
}
Future<List<String>> executeAndGetStdOut(
String executable, List<String> arguments) async {
var process = await Process.start(executable, arguments);
Future<List<String>> result = combine(
process.stdout
.transform(utf8.decoder)
.transform(const LineSplitter())
.toList(),
process.stderr
.transform(utf8.decoder)
.transform(const LineSplitter())
.toList());
int exitCode = await process.exitCode;
(await result).add("Exit code: $exitCode");
return result;
}
Future<List<String>> combine(
Future<List<String>> a, Future<List<String>> b) async {
List<String> aDone = await a;
List<String> bDone = await b;
List<String> result = new List.from(aDone);
result.addAll(bDone);
return result;
}
class Tree {
String name;
bool async = false;
List<Tree> children = <Tree>[];
}