blob: 5231bfca81230b610da5e6c2b7de88d949d1a810 [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.
*/
/**
* @assertion int exitCode
* Default value is [0].
* @description Checks that Dart process returns [0] if [exitCode] was never
* changed.
* @author iarkh@unipro.ru
*/
import "../../../Utils/expect.dart";
import "dart:io";
run_process() { print("Hello, World!"); }
run_main() async {
String executable = Platform.resolvedExecutable;
String eScript = Platform.script.toString();
int called = 0;
await Process.run(executable, ["--enable-experiment=non-nullable", eScript, "run"]).then((ProcessResult results) {
Expect.equals(0, results.exitCode);
called++;
});
Expect.equals(1, called);
}
main(List<String> args) {
if(args.length > 0)
run_process();
else {
run_main();
}
}