Need testing for interactive mode
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mars |
Triaged
|
Wishlist
|
Matt Giuca |
Bug Description
It is currently not possible to write test cases for interactive mode. This is becoming an issue, as interactive mode represents a very different semantics to normal code, and many bugs are surfacing. Currently, it is possible to test a single line of interactive mode using the -c argument (the "runtime tests" use this feature), but not a sequence of instructions.
Add a new type of test case for interactive sessions, with a "stdin" interactive session, and expected output. Include cases for the following:
x = 1 # Test using comments
x # Test print-out of local variables
add = 7
add # Test overriding globals
# Also test calling a function which calls add to make sure it still calls the global variable "add"
x = add(1, add(2, 3)) # Test nested expressions (temp vars) in interactive
x = box(4)
x = unbox(x)
(Test re-assigning the same variable to a different type -- crucially, the assignment instruction includes the old value)
Test as many interactive commands as possible.
Changed in mars: | |
importance: | High → Medium |
Changed in mars: | |
importance: | Medium → Wishlist |
Also note that with this in place, we could replace a lot of separate "compiler error" test cases with a single interactive session, which prints and recovers from single-line errors.