summaryrefslogtreecommitdiff
path: root/test/parallel/test-repl-save-load.js
diff options
context:
space:
mode:
authorVse Mozhet Byt <vsemozhetbyt@gmail.com>2017-04-28 04:06:42 +0300
committerVse Mozhet Byt <vsemozhetbyt@gmail.com>2017-05-05 17:39:05 +0300
commit8b76c3e60c7b5c274c757257580a2c0faae69097 (patch)
treea9f686995887dbeb0b5c5b23c5f3188987c99b2e /test/parallel/test-repl-save-load.js
parent6bcf65d4a788a73b3c3f27d75796609f948f7885 (diff)
downloadandroid-node-v8-8b76c3e60c7b5c274c757257580a2c0faae69097.tar.gz
android-node-v8-8b76c3e60c7b5c274c757257580a2c0faae69097.tar.bz2
android-node-v8-8b76c3e60c7b5c274c757257580a2c0faae69097.zip
test: reduce string concatenations
PR-URL: https://github.com/nodejs/node/pull/12735 Refs: https://github.com/nodejs/node/pull/12455 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Diffstat (limited to 'test/parallel/test-repl-save-load.js')
-rw-r--r--test/parallel/test-repl-save-load.js21
1 files changed, 10 insertions, 11 deletions
diff --git a/test/parallel/test-repl-save-load.js b/test/parallel/test-repl-save-load.js
index ade32659bf..746f6f2b6c 100644
--- a/test/parallel/test-repl-save-load.js
+++ b/test/parallel/test-repl-save-load.js
@@ -45,11 +45,11 @@ const saveFileName = join(common.tmpDir, 'test.save.js');
putIn.run(testFile);
// save it to a file
-putIn.run(['.save ' + saveFileName]);
+putIn.run([`.save ${saveFileName}`]);
// the file should have what I wrote
-assert.strictEqual(fs.readFileSync(saveFileName, 'utf8'), testFile.join('\n') +
- '\n');
+assert.strictEqual(fs.readFileSync(saveFileName, 'utf8'),
+ `${testFile.join('\n')}\n`);
{
// save .editor mode code
@@ -81,7 +81,7 @@ testMe.complete('inner.o', function(error, data) {
putIn.run(['.clear']);
// Load the file back in
-putIn.run(['.load ' + saveFileName]);
+putIn.run([`.load ${saveFileName}`]);
// make sure that the REPL data is "correct"
testMe.complete('inner.o', function(error, data) {
@@ -96,20 +96,19 @@ let loadFile = join(common.tmpDir, 'file.does.not.exist');
// should not break
putIn.write = function(data) {
// make sure I get a failed to load message and not some crazy error
- assert.strictEqual(data, 'Failed to load:' + loadFile + '\n');
+ assert.strictEqual(data, `Failed to load:${loadFile}\n`);
// eat me to avoid work
putIn.write = common.noop;
};
-putIn.run(['.load ' + loadFile]);
+putIn.run([`.load ${loadFile}`]);
// throw error on loading directory
loadFile = common.tmpDir;
putIn.write = function(data) {
- assert.strictEqual(data, 'Failed to load:' + loadFile +
- ' is not a valid file\n');
+ assert.strictEqual(data, `Failed to load:${loadFile} is not a valid file\n`);
putIn.write = common.noop;
};
-putIn.run(['.load ' + loadFile]);
+putIn.run([`.load ${loadFile}`]);
// clear the REPL
putIn.run(['.clear']);
@@ -121,10 +120,10 @@ const invalidFileName = join(common.tmpDir, '\0\0\0\0\0');
// should not break
putIn.write = function(data) {
// make sure I get a failed to save message and not some other error
- assert.strictEqual(data, 'Failed to save:' + invalidFileName + '\n');
+ assert.strictEqual(data, `Failed to save:${invalidFileName}\n`);
// reset to no-op
putIn.write = common.noop;
};
// save it to a file
-putIn.run(['.save ' + invalidFileName]);
+putIn.run([`.save ${invalidFileName}`]);