summaryrefslogtreecommitdiff
path: root/test/parallel/test-repl-persistent-history.js
diff options
context:
space:
mode:
authorEvan Lucas <evanlucas@me.com>2016-01-05 06:28:27 -0600
committerEvan Lucas <evanlucas@me.com>2016-01-16 13:21:53 -0600
commitda550aa063d00eee33e9c1ac5a6dccec0f4db638 (patch)
treefb7c27f7938e8b9670454ab694af3494e39b2e48 /test/parallel/test-repl-persistent-history.js
parent0ec093cd410b8797b02055a445d650f72fd16796 (diff)
downloadandroid-node-v8-da550aa063d00eee33e9c1ac5a6dccec0f4db638.tar.gz
android-node-v8-da550aa063d00eee33e9c1ac5a6dccec0f4db638.tar.bz2
android-node-v8-da550aa063d00eee33e9c1ac5a6dccec0f4db638.zip
repl: make sure historyPath is trimmed
If one were to set NODE_REPL_HISTORY to a string that contains only a space (" "), then the history file would be created with that name which can cause problems are certain systems. PR-URL: https://github.com/nodejs/node/pull/4539 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'test/parallel/test-repl-persistent-history.js')
-rw-r--r--test/parallel/test-repl-persistent-history.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/parallel/test-repl-persistent-history.js b/test/parallel/test-repl-persistent-history.js
index 81e728974f..387cef7e97 100644
--- a/test/parallel/test-repl-persistent-history.js
+++ b/test/parallel/test-repl-persistent-history.js
@@ -86,6 +86,11 @@ const tests = [
expected: [prompt, replDisabled, prompt]
},
{
+ env: { NODE_REPL_HISTORY: ' ' },
+ test: [UP],
+ expected: [prompt, replDisabled, prompt]
+ },
+ {
env: { NODE_REPL_HISTORY: '',
NODE_REPL_HISTORY_FILE: enoentHistoryPath },
test: [UP],