1 | test_scan = ->
|
2 | if DEBUG then console.log "test_scan ----------------------------"
|
3 |
|
4 | run_test [
|
5 |
|
6 | "a^^b",
|
7 | "a^^ ? b\nStop: syntax error",
|
8 |
|
9 | "(a+b",
|
10 | "(a+b ? \nStop: ) expected",
|
11 |
|
12 | "quote(1/(x*log(a*x)))", # test case A
|
13 | "1/(x*log(a*x))",
|
14 |
|
15 | "\"hello",
|
16 | "\"hello ? \nStop: runaway string",
|
17 |
|
18 | # make sure question mark can appear after newlines
|
19 |
|
20 | "a+\nb+\nc+",
|
21 | "a+\nb+\nc+ ? \nStop: syntax error",
|
22 |
|
23 | # this bug fixed in version 30 (used to give one result, 14)
|
24 |
|
25 | "(1+1)",
|
26 | "2",
|
27 |
|
28 | "2+2\n(3+3)",
|
29 | "4\n6",
|
30 |
|
31 | # plus and minus cannot cross newline
|
32 |
|
33 | "1\n-1",
|
34 | "1\n-1",
|
35 |
|
36 | "1\n+1",
|
37 | "1\n1",
|
38 | ]
|
39 |
|