Files
mongo/jstests/core/shell/run_program1.js
Binh Vo 61b3edad3a SERVER-72901 Move remaining top-level core jstests to subdirectories (#30813)
GitOrigin-RevId: 0d2fb90192f7a0074b635f2707a482e8fe238cd2
2025-04-09 20:11:18 +00:00

20 lines
760 B
JavaScript

if (!_isWindows()) {
// note that normal program exit returns 0
assert.eq(0, runProgram('true'));
assert.neq(0, runProgram('false'));
assert.neq(0, runProgram('this_program_doesnt_exit'));
// verify output visually
runProgram('echo', 'Hello', 'World.', 'How are you?');
runProgram('bash', '-c', 'echo Hello World. "How are you?"'); // only one space is
// printed between Hello
// and World
// numbers can be passed as numbers or strings
runProgram('sleep', 0.5);
runProgram('sleep', '0.5');
} else {
runProgram('cmd', '/c', 'echo hello windows');
}