shelly-shell 0.5.4

A Rust based Unix style shell with a typed and structured language syntax.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
check_repl ["id": "BOOLEAN-COMMANDS", "exit": 0, "steps": [
    ['let $calls = 0; fn ff(): Boolean { $calls = $calls + 1; echo "ff called"; false }', "quiet", ""],
    ['if ff && ff { echo TRUE } else { echo false }; echo $calls', "output", "ff called\nfalse\n1"],
    ['if (ff) && (ff) { echo TRUE } else { echo false }; echo $calls', "output", "ff called\nfalse\n2"],
    ['if !ff { echo TRUE }; echo $calls', "output", "ff called\nTRUE\n3"],
    ['fn ff(): Boolean { $calls = $calls + 1; true }; if ff || ff { echo TRUE }; echo $calls', "output", "TRUE\n4"],
    ['fn explode(): Boolean { let $zero = 0; let _ = 1 / $zero; false }', "quiet", ""],
    ['if explode && true { echo BAD }', "error", "zero"],
    ['if true || explode { echo SAFE }', "output", "SAFE"],
    ['echo ff', "output", "ff"],
    ['if shelly_missing_condition_command { echo BAD } else { echo BAD }', "error", "Executable not found: shelly_missing_condition_command"],
    ['if (shelly_missing_condition_command) { echo BAD }', "error", "Executable not found: shelly_missing_condition_command"],
    ['if true && shelly_missing_condition_command { echo BAD }', "error", "Executable not found: shelly_missing_condition_command"],
    ['if false || shelly_missing_condition_command { echo BAD }', "error", "Executable not found: shelly_missing_condition_command"],
    ['if !shelly_missing_condition_command { echo BAD }', "error", "Executable not found: shelly_missing_condition_command"],
    ['if false && shelly_missing_condition_command { echo BAD } else { echo SAFE }; if true || shelly_missing_condition_command { echo SAFE }', "output", "SAFE\nSAFE"],
    ['echo recovered', "output", "recovered"],
]]