diff --git a/test/parallel/test-process-env.js b/test/parallel/test-process-env.js index d3b1682629..21898d1942 100644 --- a/test/parallel/test-process-env.js +++ b/test/parallel/test-process-env.js @@ -1,6 +1,6 @@ 'use strict'; -require('../common'); +const common = require('../common'); const assert = require('assert'); // changes in environment should be visible to child processes @@ -67,3 +67,17 @@ assert.equal(3, date.getUTCHours()); assert.equal(5, date.getHours()); */ /* eslint-enable max-len */ + +// Environment variables should be case-insensitive on Windows, and +// case-sensitive on other platforms. +process.env.TEST = 'test'; +assert.strictEqual(process.env.TEST, 'test'); +// Check both mixed case and lower case, to avoid any regressions that might +// simply convert input to lower case. +if (common.isWindows) { + assert.strictEqual(process.env.test, 'test'); + assert.strictEqual(process.env.teST, 'test'); +} else { + assert.strictEqual(process.env.test, undefined); + assert.strictEqual(process.env.teST, undefined); +}