File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ exports[`examples > fibonacci.plz --input="not a number" > stderr 1`] = `
33`;
44
55exports[`examples > fibonacci.plz --input="not a number" > stdout 1`] = `
6- "input must be a natural number"
6+ "-- input must be a natural number"
77
88`;
99
@@ -12,7 +12,7 @@ exports[`examples > fibonacci.plz --input=-1 > stderr 1`] = `
1212`;
1313
1414exports[`examples > fibonacci.plz --input=-1 > stdout 1`] = `
15- "input must be a natural number"
15+ "-- input must be a natural number"
1616
1717`;
1818
@@ -57,7 +57,7 @@ exports[`examples > fibonacci.plz > stderr 1`] = `
5757`;
5858
5959exports[`examples > fibonacci.plz > stdout 1`] = `
60- "missing input argument"
60+ "missing -- input argument"
6161
6262`;
6363
Original file line number Diff line number Diff line change 11{
22 fibonacci: n =>
33 @if {
4- condition: :n < 2
4+ :n < 2
55 then: :n
66 else: :fibonacci(:n - 1) + :fibonacci(:n - 2)
77 }
88
99 input: @runtime { context =>
10+ // read --input from command-line arguments
1011 :context.arguments.lookup(input)
1112 }
1213
1314 output: :input match {
14- none: _ => "missing input argument"
15+ none: _ => "missing -- input argument"
1516 some: input => @if {
16- condition: :natural_number.is(:input)
17+ :natural_number.is(:input)
1718 then: :fibonacci(:input)
18- else: "input must be a natural number"
19+ else: "-- input must be a natural number"
1920 }
2021 }
2122}.output
You can’t perform that action at this time.
0 commit comments