From 5f5d6f66bfb0e698593e3bf77500ddfc4a02671b Mon Sep 17 00:00:00 2001 From: Sascha Tandel Date: Mon, 6 Nov 2017 15:19:09 +0000 Subject: [PATCH] test: include file mode in assert message If the REPL history file is created with an invalid mode include the failed mode in the error message. --- test/parallel/test-repl-history-perm.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-repl-history-perm.js b/test/parallel/test-repl-history-perm.js index 5ca8bf57a432b2..9f14ece568dc80 100644 --- a/test/parallel/test-repl-history-perm.js +++ b/test/parallel/test-repl-history-perm.js @@ -1,4 +1,7 @@ 'use strict'; + +// Verifies that the REPL history file is created with mode 0600 + // Flags: --expose_internals const common = require('../common'); @@ -39,9 +42,10 @@ const checkResults = common.mustCall(function(err, r) { r.input.end(); const stat = fs.statSync(replHistoryPath); + const fileMode = stat.mode & 0o777; assert.strictEqual( - stat.mode & 0o777, 0o600, - 'REPL history file should be mode 0600'); + fileMode, 0o600, + `REPL history file should be mode 0600 but was 0${fileMode.toString(8)}`); }); repl.createInternalRepl(