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)))",
|
13 | "1/(x*log(a*x))",
|
14 |
|
15 | "\"hello",
|
16 | "\"hello ? \nStop: runaway string",
|
17 |
|
18 |
|
19 |
|
20 | "a+\nb+\nc+",
|
21 | "a+\nb+\nc+ ? \nStop: syntax error",
|
22 |
|
23 |
|
24 |
|
25 | "(1+1)",
|
26 | "2",
|
27 |
|
28 | "2+2\n(3+3)",
|
29 | "4\n6",
|
30 |
|
31 |
|
32 |
|
33 | "1\n-1",
|
34 | "1\n-1",
|
35 |
|
36 | "1\n+1",
|
37 | "1\n1",
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 | "2(a) * 2a",
|
50 | "4*a^2",
|
51 |
|
52 | "2a3b",
|
53 | "2*a3b",
|
54 |
|
55 | "2a 3b",
|
56 | "6*a*b",
|
57 |
|
58 | "2 a 3b",
|
59 | "6*a*b",
|
60 |
|
61 | "2 a 3 b",
|
62 | "6*a*b",
|
63 |
|
64 | "2(a)3(b)",
|
65 | "6*a*b",
|
66 |
|
67 | "2(a)b*3",
|
68 | "6*a*b",
|
69 |
|
70 | "(a)2 * 2a",
|
71 | "4*a^2",
|
72 |
|
73 | "3 (2 x^3 + x^2 - 23 x + 20)",
|
74 | "6*x^3+3*x^2-69*x+60",
|
75 |
|
76 | ]
|
77 |
|