Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backspace support in hidden vars seems to still not work quite right #7

Closed
indexzero opened this issue Jun 29, 2011 · 4 comments
Closed

Comments

@indexzero
Copy link
Member

See new tests in test/interactive-test.js

@bmeck
Copy link
Member

bmeck commented Jun 29, 2011

Its a logic error w/ our regexp, going to have to use manual things to do length matching. Current implementation will only handle one backspace at a time. Fixing.

bmeck added a commit that referenced this issue Jun 29, 2011
@indexzero
Copy link
Member Author

Tests are now passing, but I am seeing an EventEmitter leak when running vows --spec now:

$ vows --spec

♢ prompt

info:   These node-prompt tests are interactive
info:   Not following instructions will result in test failure
info:   When prompted, enter: 12345 [backspace] [backspace] [enter]
prompt: password: 
  When using prompt the getInput() method when passed a complex property with hidden: true
    ✓ should respond with 123

♢ prompt

prompt: foo: prompt: test input: prompt: password: prompt: password: prompt: username: prompt: username: prompt: bad-validator: prompt: test input: prompt: riffwabbles (foobizzles): (node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace: 
    at ReadStream.<anonymous> (events.js:126:17)
    at /Users/Charlie/Nodejitsu/node-prompt/lib/prompt.js:341:9
    at EventEmitter.getInput (/Users/Charlie/Nodejitsu/node-prompt/lib/prompt.js:213:8)
    at get (/Users/Charlie/Nodejitsu/node-prompt/lib/prompt.js:164:12)
    at /Users/Charlie/Nodejitsu/node-prompt/node_modules/async/lib/async.js:118:13
    at Object.forEachSeries (/Users/Charlie/Nodejitsu/node-prompt/node_modules/async/lib/async.js:134:9)
    at EventEmitter.get (/Users/Charlie/Nodejitsu/node-prompt/lib/prompt.js:175:9)
    at Object.<anonymous> (/Users/Charlie/Nodejitsu/node-prompt/test/prompt-test.js:199:22)
    at run (/Users/Charlie/Nodejitsu/node-prompt/node_modules/vows/lib/vows/suite.js:130:31)
    at EventEmitter.<anonymous> (/Users/Charlie/Nodejitsu/node-prompt/node_modules/vows/lib/vows/suite.js:203:40)
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace: 
    at ReadStream.<anonymous> (events.js:126:17)
    at /Users/Charlie/Nodejitsu/node-prompt/lib/prompt.js:342:9
    at EventEmitter.getInput (/Users/Charlie/Nodejitsu/node-prompt/lib/prompt.js:213:8)
    at get (/Users/Charlie/Nodejitsu/node-prompt/lib/prompt.js:164:12)
    at /Users/Charlie/Nodejitsu/node-prompt/node_modules/async/lib/async.js:118:13
    at Object.forEachSeries (/Users/Charlie/Nodejitsu/node-prompt/node_modules/async/lib/async.js:134:9)
    at EventEmitter.get (/Users/Charlie/Nodejitsu/node-prompt/lib/prompt.js:175:9)
    at Object.<anonymous> (/Users/Charlie/Nodejitsu/node-prompt/test/prompt-test.js:199:22)
    at run (/Users/Charlie/Nodejitsu/node-prompt/node_modules/vows/lib/vows/suite.js:130:31)
    at EventEmitter.<anonymous> (/Users/Charlie/Nodejitsu/node-prompt/node_modules/vows/lib/vows/suite.js:203:40)


✗ Errored » callback not fired
    in When using prompt the readLine() method
    in prompt
    in test/prompt-test.js
✗ Errored » callback not fired
    in When using prompt the readLineHidden() method
    in prompt
    in test/prompt-test.js
✗ Errored » callback not fired
    in When using prompt the addProperties() method
    in prompt
    in test/prompt-test.js
✗ Errored » callback not fired
    in When using prompt the getInput() method with a simple string prompt
    in prompt
    in test/prompt-test.js
✗ Errored » callback not fired
    in When using prompt the getInput() method with a hidden field that is not supposed to be empty and we provide valid input
    in prompt
    in test/prompt-test.js
✗ Errored » callback not fired
    in When using prompt the getInput() method with a hidden field that is not supposed to be empty and we don't provide an input
    in prompt
    in test/prompt-test.js
✗ Errored » callback not fired
    in When using prompt the getInput() method with a complex property prompt and a valid input
    in prompt
    in test/prompt-test.js
✗ Errored » callback not fired
    in When using prompt the getInput() method with a complex property prompt and an invalid input
    in prompt
    in test/prompt-test.js
✗ Errored » callback not fired
    in When using prompt the getInput() method with a complex property prompt with an invalid validator (array)
    in prompt
    in test/prompt-test.js
✗ Errored » callback not fired
    in When using prompt the get() method with a simple string prompt that is not a property in prompt.properties
    in prompt
    in test/prompt-test.js
✗ Errored » callback not fired
    in When using prompt the get() method with a simple string prompt that is a property name in prompt.properties with a default value
    in prompt
    in test/prompt-test.js
✗ Errored » 1 honored ∙ 1 errored ∙ 11 dropped

@indexzero
Copy link
Member Author

Wait, I think this might be my fault. Hold on

@indexzero
Copy link
Member Author

This was an error in the tests. The event emitter "leak" was not a leak at all. The mock tests were not correctly setting the mock stdin stream so .readLine was called multiple times in parallel thus appearing as if it was a leak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants