blob: 27e26d7654c0a8076f0f5a5df98746375db557cf [file] [log] [blame]
// Copyright (c) 2017, 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.
// @dart = 2.9
/// @assertion void writeAll(Iterable objects, [String separator = ""])
/// Iterates over the given [objects] and writes them in sequence.
/// @description Check that [separator] does not affect the result output if
/// [objects] contains only one element.
/// @author iarkh@unipro.ru
import "../../../Utils/expect.dart";
import "dart:io";
run_process(IOSink sink) { sink.writeAll([1], ","); }
run_main(String mode) async {
String executable = Platform.resolvedExecutable;
String eScript = Platform.script.toString();
int called = 0;
await Process.run(executable, [eScript, mode]).then((ProcessResult results) {
Expect.equals("1", mode == "err" ? results.stderr : results.stdout);
called++;
});
Expect.equals(1, called);
}
main(List<String> args) {
if(args.length > 0)
run_process(args[0] == "err" ? stderr : stdout);
else {
run_main("out");
run_main("err");
}
}