Skip to content

Commit

Permalink
Fix the repl test, so that now it passes. Cool. Close issue jashkenas#1.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtaco committed Apr 23, 2013
1 parent 5a14567 commit fb09c8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/repl.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ iced = icedmod.runtime

replDefaults =
prompt: 'iced> ',
historyFile: path.join(process.env.HOME, '.coffee_history')
historyFile: path.join(process.env.HOME, '.iced_history')
historyMaxInputSize: 10240
eval: (input, context, filename, cb) ->
# XXX: multiline hack.
Expand Down
10 changes: 5 additions & 5 deletions test/repl.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MockOutputStream extends Stream
@written[@written.length - 1 + fromEnd].replace /\n$/, ''

# Create a dummy history file
historyFile = '.coffee_history_test'
historyFile = '.iced_history_test'
fs.writeFileSync historyFile, '1 + 2\n'

testRepl = (desc, fn) ->
Expand All @@ -45,7 +45,7 @@ testRepl 'reads history file', (input, output, repl) ->
eq '3', output.lastWrite()

testRepl "starts with coffee prompt", (input, output) ->
eq 'coffee> ', output.lastWrite(0)
eq 'iced> ', output.lastWrite(0)

testRepl "writes eval to output", (input, output) ->
input.emitLine '1+1'
Expand All @@ -70,14 +70,14 @@ testRepl "empty command evaluates to undefined", (input, output) ->

testRepl "ctrl-v toggles multiline prompt", (input, output) ->
input.emit 'keypress', null, ctrlV
eq '------> ', output.lastWrite(0)
eq '----> ', output.lastWrite(0)
input.emit 'keypress', null, ctrlV
eq 'coffee> ', output.lastWrite(0)
eq 'iced> ', output.lastWrite(0)

testRepl "multiline continuation changes prompt", (input, output) ->
input.emit 'keypress', null, ctrlV
input.emitLine ''
eq '....... ', output.lastWrite(0)
eq '..... ', output.lastWrite(0)

testRepl "evaluates multiline", (input, output) ->
# Stubs. Could assert on their use.
Expand Down

0 comments on commit fb09c8f

Please sign in to comment.