From 5e59c2d21d00e709d87b1e2a65ec84e3d014f762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20H=C3=B3di?= Date: Wed, 14 Jun 2017 09:51:27 +0200 Subject: [PATCH] test: increase coverage for internal/module.js PR-URL: https://github.com/nodejs/node/pull/13673 Reviewed-By: Colin Ihrig Reviewed-By: Refael Ackermann Reviewed-By: James M Snell --- .../test-internal-modules-strip-shebang.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/parallel/test-internal-modules-strip-shebang.js diff --git a/test/parallel/test-internal-modules-strip-shebang.js b/test/parallel/test-internal-modules-strip-shebang.js new file mode 100644 index 00000000000000..93be3d41981f50 --- /dev/null +++ b/test/parallel/test-internal-modules-strip-shebang.js @@ -0,0 +1,14 @@ +// Flags: --expose-internals +'use strict'; +require('../common'); + +const assert = require('assert'); +const stripShebang = require('internal/module').stripShebang; + +[ + ['', ''], + ['aa', 'aa'], + ['#!', ''], + ['#!bin/bash', ''], + ['#!bin/bash\naa', '\naa'], +].forEach((i) => assert.strictEqual(stripShebang(i[0]), i[1]));