|
| 1 | +Debug = true |
| 2 | + |
| 3 | +[33m[stage-7] [0m[94mRunning tests for Stage #7: r1[0m |
| 4 | +[33m[stage-7] [test-1] [0m[94mRunning test case: 1[0m |
| 5 | +[33m[stage-7] [test-1] [0m[94mWriting contents to ./test.lox:[0m |
| 6 | +[33m[stage-7] [test-1] [0m[33m[test.lox][0m var a = "outer"; |
| 7 | +[33m[stage-7] [test-1] [0m[33m[test.lox][0m { |
| 8 | +[33m[stage-7] [test-1] [0m[33m[test.lox][0m fun foo() { |
| 9 | +[33m[stage-7] [test-1] [0m[33m[test.lox][0m print a; |
| 10 | +[33m[stage-7] [test-1] [0m[33m[test.lox][0m } |
| 11 | +[33m[stage-7] [test-1] [0m[33m[test.lox][0m |
| 12 | +[33m[stage-7] [test-1] [0m[33m[test.lox][0m foo(); // expect: outer |
| 13 | +[33m[stage-7] [test-1] [0m[33m[test.lox][0m var a = "inner"; |
| 14 | +[33m[stage-7] [test-1] [0m[33m[test.lox][0m foo(); // expect: outer |
| 15 | +[33m[stage-7] [test-1] [0m[33m[test.lox][0m } |
| 16 | +[33m[stage-7] [test-1] [0m[94m$ ./your_program.sh run test.lox[0m |
| 17 | +[33m[your_program] [0mouter |
| 18 | +[33m[your_program] [0mouter |
| 19 | +[33m[stage-7] [test-1] [0m[92m✓ 2 line(s) match on stdout[0m |
| 20 | +[33m[stage-7] [test-1] [0m[92m✓ Received exit code 0.[0m |
| 21 | +[33m[stage-7] [test-2] [0m[94mRunning test case: 2[0m |
| 22 | +[33m[stage-7] [test-2] [0m[94mWriting contents to ./test.lox:[0m |
| 23 | +[33m[stage-7] [test-2] [0m[33m[test.lox][0m fun global() { |
| 24 | +[33m[stage-7] [test-2] [0m[33m[test.lox][0m print "global"; |
| 25 | +[33m[stage-7] [test-2] [0m[33m[test.lox][0m } |
| 26 | +[33m[stage-7] [test-2] [0m[33m[test.lox][0m |
| 27 | +[33m[stage-7] [test-2] [0m[33m[test.lox][0m { |
| 28 | +[33m[stage-7] [test-2] [0m[33m[test.lox][0m fun f() { |
| 29 | +[33m[stage-7] [test-2] [0m[33m[test.lox][0m global(); |
| 30 | +[33m[stage-7] [test-2] [0m[33m[test.lox][0m } |
| 31 | +[33m[stage-7] [test-2] [0m[33m[test.lox][0m |
| 32 | +[33m[stage-7] [test-2] [0m[33m[test.lox][0m f(); |
| 33 | +[33m[stage-7] [test-2] [0m[33m[test.lox][0m fun global() { |
| 34 | +[33m[stage-7] [test-2] [0m[33m[test.lox][0m print "local"; |
| 35 | +[33m[stage-7] [test-2] [0m[33m[test.lox][0m } |
| 36 | +[33m[stage-7] [test-2] [0m[33m[test.lox][0m f(); |
| 37 | +[33m[stage-7] [test-2] [0m[33m[test.lox][0m } |
| 38 | +[33m[stage-7] [test-2] [0m[94m$ ./your_program.sh run test.lox[0m |
| 39 | +[33m[your_program] [0mglobal |
| 40 | +[33m[your_program] [0mglobal |
| 41 | +[33m[stage-7] [test-2] [0m[92m✓ 2 line(s) match on stdout[0m |
| 42 | +[33m[stage-7] [test-2] [0m[92m✓ Received exit code 0.[0m |
| 43 | +[33m[stage-7] [test-3] [0m[94mRunning test case: 3[0m |
| 44 | +[33m[stage-7] [test-3] [0m[94mWriting contents to ./test.lox:[0m |
| 45 | +[33m[stage-7] [test-3] [0m[33m[test.lox][0m // Multiple Nested Functions with Shadowing |
| 46 | +[33m[stage-7] [test-3] [0m[33m[test.lox][0m var x = "global"; |
| 47 | +[33m[stage-7] [test-3] [0m[33m[test.lox][0m |
| 48 | +[33m[stage-7] [test-3] [0m[33m[test.lox][0m fun outer() { |
| 49 | +[33m[stage-7] [test-3] [0m[33m[test.lox][0m var x = "outer"; |
| 50 | +[33m[stage-7] [test-3] [0m[33m[test.lox][0m |
| 51 | +[33m[stage-7] [test-3] [0m[33m[test.lox][0m fun middle() { |
| 52 | +[33m[stage-7] [test-3] [0m[33m[test.lox][0m fun inner() { |
| 53 | +[33m[stage-7] [test-3] [0m[33m[test.lox][0m print x; // Should capture "outer", not "global" or "inner" |
| 54 | +[33m[stage-7] [test-3] [0m[33m[test.lox][0m } |
| 55 | +[33m[stage-7] [test-3] [0m[33m[test.lox][0m |
| 56 | +[33m[stage-7] [test-3] [0m[33m[test.lox][0m inner(); |
| 57 | +[33m[stage-7] [test-3] [0m[33m[test.lox][0m var x = "middle"; |
| 58 | +[33m[stage-7] [test-3] [0m[33m[test.lox][0m inner(); // Should still print "outer" |
| 59 | +[33m[stage-7] [test-3] [0m[33m[test.lox][0m } |
| 60 | +[33m[stage-7] [test-3] [0m[33m[test.lox][0m |
| 61 | +[33m[stage-7] [test-3] [0m[33m[test.lox][0m middle(); |
| 62 | +[33m[stage-7] [test-3] [0m[33m[test.lox][0m } |
| 63 | +[33m[stage-7] [test-3] [0m[33m[test.lox][0m |
| 64 | +[33m[stage-7] [test-3] [0m[33m[test.lox][0m outer(); |
| 65 | +[33m[stage-7] [test-3] [0m[94m$ ./your_program.sh run test.lox[0m |
| 66 | +[33m[your_program] [0mouter |
| 67 | +[33m[your_program] [0mouter |
| 68 | +[33m[stage-7] [test-3] [0m[92m✓ 2 line(s) match on stdout[0m |
| 69 | +[33m[stage-7] [test-3] [0m[92m✓ Received exit code 0.[0m |
| 70 | +[33m[stage-7] [test-4] [0m[94mRunning test case: 4[0m |
| 71 | +[33m[stage-7] [test-4] [0m[94mWriting contents to ./test.lox:[0m |
| 72 | +[33m[stage-7] [test-4] [0m[33m[test.lox][0m // Function Returning a Function |
| 73 | +[33m[stage-7] [test-4] [0m[33m[test.lox][0m var count = 0; |
| 74 | +[33m[stage-7] [test-4] [0m[33m[test.lox][0m |
| 75 | +[33m[stage-7] [test-4] [0m[33m[test.lox][0m { |
| 76 | +[33m[stage-7] [test-4] [0m[33m[test.lox][0m fun makeCounter() { |
| 77 | +[33m[stage-7] [test-4] [0m[33m[test.lox][0m fun counter() { |
| 78 | +[33m[stage-7] [test-4] [0m[33m[test.lox][0m count = count + 1; |
| 79 | +[33m[stage-7] [test-4] [0m[33m[test.lox][0m print count; |
| 80 | +[33m[stage-7] [test-4] [0m[33m[test.lox][0m } |
| 81 | +[33m[stage-7] [test-4] [0m[33m[test.lox][0m return counter; |
| 82 | +[33m[stage-7] [test-4] [0m[33m[test.lox][0m } |
| 83 | +[33m[stage-7] [test-4] [0m[33m[test.lox][0m |
| 84 | +[33m[stage-7] [test-4] [0m[33m[test.lox][0m var counter1 = makeCounter(); |
| 85 | +[33m[stage-7] [test-4] [0m[33m[test.lox][0m counter1(); // Should print 1 |
| 86 | +[33m[stage-7] [test-4] [0m[33m[test.lox][0m counter1(); // Should print 2 |
| 87 | +[33m[stage-7] [test-4] [0m[33m[test.lox][0m |
| 88 | +[33m[stage-7] [test-4] [0m[33m[test.lox][0m var count = 0; |
| 89 | +[33m[stage-7] [test-4] [0m[33m[test.lox][0m counter1(); // Should print 3 |
| 90 | +[33m[stage-7] [test-4] [0m[33m[test.lox][0m } |
| 91 | +[33m[stage-7] [test-4] [0m[94m$ ./your_program.sh run test.lox[0m |
| 92 | +[33m[your_program] [0m1 |
| 93 | +[33m[your_program] [0m2 |
| 94 | +[33m[your_program] [0m3 |
| 95 | +[33m[stage-7] [test-4] [0m[92m✓ 3 line(s) match on stdout[0m |
| 96 | +[33m[stage-7] [test-4] [0m[92m✓ Received exit code 0.[0m |
| 97 | +[33m[stage-7] [0m[92mTest passed.[0m |
| 98 | + |
| 99 | +[33m[stage-6] [0m[94mRunning tests for Stage #6: r2[0m |
| 100 | +[33m[stage-6] [test-1] [0m[94mRunning test case: 1[0m |
| 101 | +[33m[stage-6] [test-1] [0m[94mWriting contents to ./test.lox:[0m |
| 102 | +[33m[stage-6] [test-1] [0m[33m[test.lox][0m |
| 103 | +[33m[stage-6] [test-1] [0m[94m$ ./your_program.sh run test.lox[0m |
| 104 | +[33m[stage-6] [test-1] [0m[92m✓ 1 line(s) match on stdout[0m |
| 105 | +[33m[stage-6] [test-1] [0m[92m✓ Received exit code 0.[0m |
| 106 | +[33m[stage-6] [test-2] [0m[94mRunning test case: 2[0m |
| 107 | +[33m[stage-6] [test-2] [0m[94mWriting contents to ./test.lox:[0m |
| 108 | +[33m[stage-6] [test-2] [0m[33m[test.lox][0m |
| 109 | +[33m[stage-6] [test-2] [0m[94m$ ./your_program.sh run test.lox[0m |
| 110 | +[33m[stage-6] [test-2] [0m[92m✓ 1 line(s) match on stdout[0m |
| 111 | +[33m[stage-6] [test-2] [0m[92m✓ Received exit code 0.[0m |
| 112 | +[33m[stage-6] [test-3] [0m[94mRunning test case: 3[0m |
| 113 | +[33m[stage-6] [test-3] [0m[94mWriting contents to ./test.lox:[0m |
| 114 | +[33m[stage-6] [test-3] [0m[33m[test.lox][0m |
| 115 | +[33m[stage-6] [test-3] [0m[94m$ ./your_program.sh run test.lox[0m |
| 116 | +[33m[stage-6] [test-3] [0m[92m✓ 1 line(s) match on stdout[0m |
| 117 | +[33m[stage-6] [test-3] [0m[92m✓ Received exit code 0.[0m |
| 118 | +[33m[stage-6] [test-4] [0m[94mRunning test case: 4[0m |
| 119 | +[33m[stage-6] [test-4] [0m[94mWriting contents to ./test.lox:[0m |
| 120 | +[33m[stage-6] [test-4] [0m[33m[test.lox][0m |
| 121 | +[33m[stage-6] [test-4] [0m[94m$ ./your_program.sh run test.lox[0m |
| 122 | +[33m[stage-6] [test-4] [0m[92m✓ 1 line(s) match on stdout[0m |
| 123 | +[33m[stage-6] [test-4] [0m[92m✓ Received exit code 0.[0m |
| 124 | +[33m[stage-6] [0m[92mTest passed.[0m |
| 125 | + |
| 126 | +[33m[stage-5] [0m[94mRunning tests for Stage #5: r3[0m |
| 127 | +[33m[stage-5] [test-1] [0m[94mRunning test case: 1[0m |
| 128 | +[33m[stage-5] [test-1] [0m[94mWriting contents to ./test.lox:[0m |
| 129 | +[33m[stage-5] [test-1] [0m[33m[test.lox][0m |
| 130 | +[33m[stage-5] [test-1] [0m[94m$ ./your_program.sh run test.lox[0m |
| 131 | +[33m[stage-5] [test-1] [0m[92m✓ 1 line(s) match on stdout[0m |
| 132 | +[33m[stage-5] [test-1] [0m[92m✓ Received exit code 0.[0m |
| 133 | +[33m[stage-5] [test-2] [0m[94mRunning test case: 2[0m |
| 134 | +[33m[stage-5] [test-2] [0m[94mWriting contents to ./test.lox:[0m |
| 135 | +[33m[stage-5] [test-2] [0m[33m[test.lox][0m |
| 136 | +[33m[stage-5] [test-2] [0m[94m$ ./your_program.sh run test.lox[0m |
| 137 | +[33m[stage-5] [test-2] [0m[92m✓ 1 line(s) match on stdout[0m |
| 138 | +[33m[stage-5] [test-2] [0m[92m✓ Received exit code 0.[0m |
| 139 | +[33m[stage-5] [test-3] [0m[94mRunning test case: 3[0m |
| 140 | +[33m[stage-5] [test-3] [0m[94mWriting contents to ./test.lox:[0m |
| 141 | +[33m[stage-5] [test-3] [0m[33m[test.lox][0m |
| 142 | +[33m[stage-5] [test-3] [0m[94m$ ./your_program.sh run test.lox[0m |
| 143 | +[33m[stage-5] [test-3] [0m[92m✓ 1 line(s) match on stdout[0m |
| 144 | +[33m[stage-5] [test-3] [0m[92m✓ Received exit code 0.[0m |
| 145 | +[33m[stage-5] [test-4] [0m[94mRunning test case: 4[0m |
| 146 | +[33m[stage-5] [test-4] [0m[94mWriting contents to ./test.lox:[0m |
| 147 | +[33m[stage-5] [test-4] [0m[33m[test.lox][0m |
| 148 | +[33m[stage-5] [test-4] [0m[94m$ ./your_program.sh run test.lox[0m |
| 149 | +[33m[stage-5] [test-4] [0m[92m✓ 1 line(s) match on stdout[0m |
| 150 | +[33m[stage-5] [test-4] [0m[92m✓ Received exit code 0.[0m |
| 151 | +[33m[stage-5] [0m[92mTest passed.[0m |
| 152 | + |
| 153 | +[33m[stage-4] [0m[94mRunning tests for Stage #4: r4[0m |
| 154 | +[33m[stage-4] [test-1] [0m[94mRunning test case: 1[0m |
| 155 | +[33m[stage-4] [test-1] [0m[94mWriting contents to ./test.lox:[0m |
| 156 | +[33m[stage-4] [test-1] [0m[33m[test.lox][0m var a = "value"; |
| 157 | +[33m[stage-4] [test-1] [0m[33m[test.lox][0m var a = a; // global scope, so this is allowed |
| 158 | +[33m[stage-4] [test-1] [0m[33m[test.lox][0m print a; // expect: value |
| 159 | +[33m[stage-4] [test-1] [0m[33m[test.lox][0m |
| 160 | +[33m[stage-4] [test-1] [0m[94m$ ./your_program.sh run test.lox[0m |
| 161 | +[33m[your_program] [0mvalue |
| 162 | +[33m[stage-4] [test-1] [0m[92m✓ 1 line(s) match on stdout[0m |
| 163 | +[33m[stage-4] [test-1] [0m[92m✓ Received exit code 0.[0m |
| 164 | +[33m[stage-4] [test-2] [0m[94mRunning test case: 2[0m |
| 165 | +[33m[stage-4] [test-2] [0m[94mWriting contents to ./test.lox:[0m |
| 166 | +[33m[stage-4] [test-2] [0m[33m[test.lox][0m var a = "outer"; |
| 167 | +[33m[stage-4] [test-2] [0m[33m[test.lox][0m { |
| 168 | +[33m[stage-4] [test-2] [0m[33m[test.lox][0m var a = a; // Error at 'a': Can't read local variable in its own initializer. |
| 169 | +[33m[stage-4] [test-2] [0m[33m[test.lox][0m } |
| 170 | +[33m[stage-4] [test-2] [0m[94m$ ./your_program.sh run test.lox[0m |
| 171 | +[33m[your_program] [0m[line 3] Error at 'a': Can't read local variable in its own initializer. |
| 172 | +[33m[stage-4] [test-2] [0m[92m✓ 1 line(s) match on stdout[0m |
| 173 | +[33m[stage-4] [test-2] [0m[92m✓ Received exit code 65.[0m |
| 174 | +[33m[stage-4] [test-3] [0m[94mRunning test case: 3[0m |
| 175 | +[33m[stage-4] [test-3] [0m[94mWriting contents to ./test.lox:[0m |
| 176 | +[33m[stage-4] [test-3] [0m[33m[test.lox][0m |
| 177 | +[33m[stage-4] [test-3] [0m[94m$ ./your_program.sh run test.lox[0m |
| 178 | +[33m[stage-4] [test-3] [0m[92m✓ 1 line(s) match on stdout[0m |
| 179 | +[33m[stage-4] [test-3] [0m[92m✓ Received exit code 0.[0m |
| 180 | +[33m[stage-4] [test-4] [0m[94mRunning test case: 4[0m |
| 181 | +[33m[stage-4] [test-4] [0m[94mWriting contents to ./test.lox:[0m |
| 182 | +[33m[stage-4] [test-4] [0m[33m[test.lox][0m |
| 183 | +[33m[stage-4] [test-4] [0m[94m$ ./your_program.sh run test.lox[0m |
| 184 | +[33m[stage-4] [test-4] [0m[92m✓ 1 line(s) match on stdout[0m |
| 185 | +[33m[stage-4] [test-4] [0m[92m✓ Received exit code 0.[0m |
| 186 | +[33m[stage-4] [0m[92mTest passed.[0m |
| 187 | + |
| 188 | +[33m[stage-3] [0m[94mRunning tests for Stage #3: r5[0m |
| 189 | +[33m[stage-3] [test-1] [0m[94mRunning test case: 1[0m |
| 190 | +[33m[stage-3] [test-1] [0m[94mWriting contents to ./test.lox:[0m |
| 191 | +[33m[stage-3] [test-1] [0m[33m[test.lox][0m return "foo"; |
| 192 | +[33m[stage-3] [test-1] [0m[94m$ ./your_program.sh run test.lox[0m |
| 193 | +[33m[your_program] [0m[line 1] Error at 'return': Can't return from top-level code. |
| 194 | +[33m[stage-3] [test-1] [0m[92m✓ 1 line(s) match on stdout[0m |
| 195 | +[33m[stage-3] [test-1] [0m[92m✓ Received exit code 65.[0m |
| 196 | +[33m[stage-3] [test-2] [0m[94mRunning test case: 2[0m |
| 197 | +[33m[stage-3] [test-2] [0m[94mWriting contents to ./test.lox:[0m |
| 198 | +[33m[stage-3] [test-2] [0m[33m[test.lox][0m |
| 199 | +[33m[stage-3] [test-2] [0m[94m$ ./your_program.sh run test.lox[0m |
| 200 | +[33m[stage-3] [test-2] [0m[92m✓ 1 line(s) match on stdout[0m |
| 201 | +[33m[stage-3] [test-2] [0m[92m✓ Received exit code 0.[0m |
| 202 | +[33m[stage-3] [test-3] [0m[94mRunning test case: 3[0m |
| 203 | +[33m[stage-3] [test-3] [0m[94mWriting contents to ./test.lox:[0m |
| 204 | +[33m[stage-3] [test-3] [0m[33m[test.lox][0m |
| 205 | +[33m[stage-3] [test-3] [0m[94m$ ./your_program.sh run test.lox[0m |
| 206 | +[33m[stage-3] [test-3] [0m[92m✓ 1 line(s) match on stdout[0m |
| 207 | +[33m[stage-3] [test-3] [0m[92m✓ Received exit code 0.[0m |
| 208 | +[33m[stage-3] [test-4] [0m[94mRunning test case: 4[0m |
| 209 | +[33m[stage-3] [test-4] [0m[94mWriting contents to ./test.lox:[0m |
| 210 | +[33m[stage-3] [test-4] [0m[33m[test.lox][0m |
| 211 | +[33m[stage-3] [test-4] [0m[94m$ ./your_program.sh run test.lox[0m |
| 212 | +[33m[stage-3] [test-4] [0m[92m✓ 1 line(s) match on stdout[0m |
| 213 | +[33m[stage-3] [test-4] [0m[92m✓ Received exit code 0.[0m |
| 214 | +[33m[stage-3] [0m[92mTest passed.[0m |
| 215 | + |
| 216 | +[33m[stage-2] [0m[94mRunning tests for Stage #2: r6[0m |
| 217 | +[33m[stage-2] [test-1] [0m[94mRunning test case: 1[0m |
| 218 | +[33m[stage-2] [test-1] [0m[94mWriting contents to ./test.lox:[0m |
| 219 | +[33m[stage-2] [test-1] [0m[33m[test.lox][0m if (false) { |
| 220 | +[33m[stage-2] [test-1] [0m[33m[test.lox][0m print notDefined; |
| 221 | +[33m[stage-2] [test-1] [0m[33m[test.lox][0m } |
| 222 | +[33m[stage-2] [test-1] [0m[33m[test.lox][0m |
| 223 | +[33m[stage-2] [test-1] [0m[33m[test.lox][0m print "ok"; // expect: ok |
| 224 | +[33m[stage-2] [test-1] [0m[33m[test.lox][0m |
| 225 | +[33m[stage-2] [test-1] [0m[94m$ ./your_program.sh run test.lox[0m |
| 226 | +[33m[your_program] [0mok |
| 227 | +[33m[stage-2] [test-1] [0m[92m✓ 1 line(s) match on stdout[0m |
| 228 | +[33m[stage-2] [test-1] [0m[92m✓ Received exit code 0.[0m |
| 229 | +[33m[stage-2] [test-2] [0m[94mRunning test case: 2[0m |
| 230 | +[33m[stage-2] [test-2] [0m[94mWriting contents to ./test.lox:[0m |
| 231 | +[33m[stage-2] [test-2] [0m[33m[test.lox][0m print a; // expect: compile error |
| 232 | +[33m[stage-2] [test-2] [0m[33m[test.lox][0m var a = "value"; |
| 233 | +[33m[stage-2] [test-2] [0m[33m[test.lox][0m print a; // expect: value |
| 234 | +[33m[stage-2] [test-2] [0m[33m[test.lox][0m |
| 235 | +[33m[stage-2] [test-2] [0m[94m$ ./your_program.sh run test.lox[0m |
| 236 | +[33m[your_program] [0mUndefined variable 'a'. |
| 237 | +[33m[your_program] [0m[line 1] |
| 238 | +[33m[stage-2] [test-2] [0m[92m✓ 1 line(s) match on stdout[0m |
| 239 | +[33m[stage-2] [test-2] [0m[92m✓ Received exit code 70.[0m |
| 240 | +[33m[stage-2] [test-3] [0m[94mRunning test case: 3[0m |
| 241 | +[33m[stage-2] [test-3] [0m[94mWriting contents to ./test.lox:[0m |
| 242 | +[33m[stage-2] [test-3] [0m[33m[test.lox][0m |
| 243 | +[33m[stage-2] [test-3] [0m[94m$ ./your_program.sh run test.lox[0m |
| 244 | +[33m[stage-2] [test-3] [0m[92m✓ 1 line(s) match on stdout[0m |
| 245 | +[33m[stage-2] [test-3] [0m[92m✓ Received exit code 0.[0m |
| 246 | +[33m[stage-2] [test-4] [0m[94mRunning test case: 4[0m |
| 247 | +[33m[stage-2] [test-4] [0m[94mWriting contents to ./test.lox:[0m |
| 248 | +[33m[stage-2] [test-4] [0m[33m[test.lox][0m |
| 249 | +[33m[stage-2] [test-4] [0m[94m$ ./your_program.sh run test.lox[0m |
| 250 | +[33m[stage-2] [test-4] [0m[92m✓ 1 line(s) match on stdout[0m |
| 251 | +[33m[stage-2] [test-4] [0m[92m✓ Received exit code 0.[0m |
| 252 | +[33m[stage-2] [0m[92mTest passed.[0m |
| 253 | + |
| 254 | +[33m[stage-1] [0m[94mRunning tests for Stage #1: r7[0m |
| 255 | +[33m[stage-1] [test-1] [0m[94mRunning test case: 1[0m |
| 256 | +[33m[stage-1] [test-1] [0m[94mWriting contents to ./test.lox:[0m |
| 257 | +[33m[stage-1] [test-1] [0m[33m[test.lox][0m { |
| 258 | +[33m[stage-1] [test-1] [0m[33m[test.lox][0m var a = "value"; |
| 259 | +[33m[stage-1] [test-1] [0m[33m[test.lox][0m var a = "other"; // Error at 'a': Already a variable with this name in this scope. |
| 260 | +[33m[stage-1] [test-1] [0m[33m[test.lox][0m } |
| 261 | +[33m[stage-1] [test-1] [0m[33m[test.lox][0m |
| 262 | +[33m[stage-1] [test-1] [0m[94m$ ./your_program.sh run test.lox[0m |
| 263 | +[33m[your_program] [0m[line 3] Error at 'a': Already a variable with this name in this scope. |
| 264 | +[33m[stage-1] [test-1] [0m[92m✓ 1 line(s) match on stdout[0m |
| 265 | +[33m[stage-1] [test-1] [0m[92m✓ Received exit code 65.[0m |
| 266 | +[33m[stage-1] [test-2] [0m[94mRunning test case: 2[0m |
| 267 | +[33m[stage-1] [test-2] [0m[94mWriting contents to ./test.lox:[0m |
| 268 | +[33m[stage-1] [test-2] [0m[33m[test.lox][0m fun foo(a) { |
| 269 | +[33m[stage-1] [test-2] [0m[33m[test.lox][0m var a; // Error at 'a': Already a variable with this name in this scope. |
| 270 | +[33m[stage-1] [test-2] [0m[33m[test.lox][0m } |
| 271 | +[33m[stage-1] [test-2] [0m[33m[test.lox][0m |
| 272 | +[33m[stage-1] [test-2] [0m[94m$ ./your_program.sh run test.lox[0m |
| 273 | +[33m[your_program] [0m[line 2] Error at 'a': Already a variable with this name in this scope. |
| 274 | +[33m[stage-1] [test-2] [0m[92m✓ 1 line(s) match on stdout[0m |
| 275 | +[33m[stage-1] [test-2] [0m[92m✓ Received exit code 65.[0m |
| 276 | +[33m[stage-1] [test-3] [0m[94mRunning test case: 3[0m |
| 277 | +[33m[stage-1] [test-3] [0m[94mWriting contents to ./test.lox:[0m |
| 278 | +[33m[stage-1] [test-3] [0m[33m[test.lox][0m fun foo(arg, |
| 279 | +[33m[stage-1] [test-3] [0m[33m[test.lox][0m arg) { // Error at 'arg': Already a variable with this name in this scope. |
| 280 | +[33m[stage-1] [test-3] [0m[33m[test.lox][0m "body"; |
| 281 | +[33m[stage-1] [test-3] [0m[33m[test.lox][0m } |
| 282 | +[33m[stage-1] [test-3] [0m[33m[test.lox][0m |
| 283 | +[33m[stage-1] [test-3] [0m[94m$ ./your_program.sh run test.lox[0m |
| 284 | +[33m[your_program] [0m[line 2] Error at 'arg': Already a variable with this name in this scope. |
| 285 | +[33m[stage-1] [test-3] [0m[92m✓ 1 line(s) match on stdout[0m |
| 286 | +[33m[stage-1] [test-3] [0m[92m✓ Received exit code 65.[0m |
| 287 | +[33m[stage-1] [test-4] [0m[94mRunning test case: 4[0m |
| 288 | +[33m[stage-1] [test-4] [0m[94mWriting contents to ./test.lox:[0m |
| 289 | +[33m[stage-1] [test-4] [0m[33m[test.lox][0m var a = "1"; |
| 290 | +[33m[stage-1] [test-4] [0m[33m[test.lox][0m print a; // expect: 1 |
| 291 | +[33m[stage-1] [test-4] [0m[33m[test.lox][0m var a; |
| 292 | +[33m[stage-1] [test-4] [0m[33m[test.lox][0m print a; // expect: nil |
| 293 | +[33m[stage-1] [test-4] [0m[33m[test.lox][0m |
| 294 | +[33m[stage-1] [test-4] [0m[33m[test.lox][0m var a = "2"; |
| 295 | +[33m[stage-1] [test-4] [0m[33m[test.lox][0m print a; // expect: 2 |
| 296 | +[33m[stage-1] [test-4] [0m[33m[test.lox][0m |
| 297 | +[33m[stage-1] [test-4] [0m[33m[test.lox][0m { |
| 298 | +[33m[stage-1] [test-4] [0m[33m[test.lox][0m var a = "1"; |
| 299 | +[33m[stage-1] [test-4] [0m[33m[test.lox][0m var a = "2"; |
| 300 | +[33m[stage-1] [test-4] [0m[33m[test.lox][0m print a; // expect: compile error |
| 301 | +[33m[stage-1] [test-4] [0m[33m[test.lox][0m } |
| 302 | +[33m[stage-1] [test-4] [0m[94m$ ./your_program.sh run test.lox[0m |
| 303 | +[33m[your_program] [0m[line 11] Error at 'a': Already a variable with this name in this scope. |
| 304 | +[33m[stage-1] [test-4] [0m[92m✓ 1 line(s) match on stdout[0m |
| 305 | +[33m[stage-1] [test-4] [0m[92m✓ Received exit code 65.[0m |
| 306 | +[33m[stage-1] [0m[92mTest passed.[0m |
0 commit comments