diff --git a/test/repl.coffee b/test/repl.coffee index 25877cee..b48def74 100644 --- a/test/repl.coffee +++ b/test/repl.coffee @@ -80,3 +80,14 @@ testRepl "evaluates multiline", (input, output) -> input.emitLine ' 1 + 1' input.emit 'keypress', null, ctrlV eq '2', output.lastWrite() + +testRepl "variables in scope are preserved", (input, output) -> + input.emitLine 'a = 1' + input.emitLine 'do -> a = 2' + input.emitLine 'a' + eq '2', output.lastWrite() + +testRepl "existencial assignment of previously declared variable", (input, output) -> + input.emitLine 'a = null' + input.emitLine 'a ?= 42' + eq '42', output.lastWrite() \ No newline at end of file