diff options
author | Vse Mozhet Byt <vsemozhetbyt@gmail.com> | 2017-04-28 04:06:42 +0300 |
---|---|---|
committer | Vse Mozhet Byt <vsemozhetbyt@gmail.com> | 2017-05-05 17:39:05 +0300 |
commit | 8b76c3e60c7b5c274c757257580a2c0faae69097 (patch) | |
tree | a9f686995887dbeb0b5c5b23c5f3188987c99b2e /test/parallel/test-stdin-from-file.js | |
parent | 6bcf65d4a788a73b3c3f27d75796609f948f7885 (diff) | |
download | node-new-8b76c3e60c7b5c274c757257580a2c0faae69097.tar.gz |
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-stdin-from-file.js')
-rw-r--r-- | test/parallel/test-stdin-from-file.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/test/parallel/test-stdin-from-file.js b/test/parallel/test-stdin-from-file.js index 9a847118bd..908416e721 100644 --- a/test/parallel/test-stdin-from-file.js +++ b/test/parallel/test-stdin-from-file.js @@ -8,8 +8,7 @@ const fs = require('fs'); const stdoutScript = join(common.fixturesDir, 'echo-close-check.js'); const tmpFile = join(common.tmpDir, 'stdin.txt'); -const cmd = '"' + process.argv[0] + '" "' + stdoutScript + '" < "' + - tmpFile + '"'; +const cmd = `"${process.argv[0]}" "${stdoutScript}" < "${tmpFile}"`; const string = 'abc\nümlaut.\nsomething else\n' + '南越国是前203年至前111年存在于岭南地区的一个国家,国都位于番禺,' + @@ -26,7 +25,7 @@ const string = 'abc\nümlaut.\nsomething else\n' + common.refreshTmpDir(); -console.log(cmd + '\n\n'); +console.log(`${cmd}\n\n`); fs.writeFileSync(tmpFile, string); @@ -34,6 +33,6 @@ childProcess.exec(cmd, common.mustCall(function(err, stdout, stderr) { fs.unlinkSync(tmpFile); assert.ifError(err); - assert.strictEqual(stdout, 'hello world\r\n' + string); + assert.strictEqual(stdout, `hello world\r\n${string}`); assert.strictEqual('', stderr); })); |