From bc4276179a95aa0e41de85ceadd238e9f79ef1b7 Mon Sep 17 00:00:00 2001 From: Ujjwal Sharma Date: Sun, 11 Mar 2018 01:35:40 +0530 Subject: [PATCH] test: rename regression tests with descriptive file names Rename the tests appropriately alongside mentioning the subsystem Also, make a few basic changes to make sure the tests conform to the standard test structure - Rename test-regress-GH-9819 to test-crypto-tostring-segfault - Rename test-regress-GH-5051 to test-http-addrequest-localaddress - Rename test-regress-GH-5727 to test-net-listen-invalid-port - Rename test-regress-GH-5927 to test-tty-stdin-pipe - Rename test-regress-GH-6235 to test-v8-global-setter Refs: https://github.com/nodejs/node/issues/19105 Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure --- ...t-regress-GH-9819.js => test-crypto-tostring-segfault.js} | 5 +++++ ...gress-GH-5051.js => test-http-addrequest-localaddress.js} | 5 +++++ ...st-regress-GH-5727.js => test-net-listen-invalid-port.js} | 5 +++++ .../{test-regress-GH-5927.js => test-tty-stdin-pipe.js} | 4 ++++ .../{test-regress-GH-6235.js => test-v8-global-setter.js} | 4 ++++ 5 files changed, 23 insertions(+) rename test/parallel/{test-regress-GH-9819.js => test-crypto-tostring-segfault.js} (74%) rename test/parallel/{test-regress-GH-5051.js => test-http-addrequest-localaddress.js} (85%) rename test/parallel/{test-regress-GH-5727.js => test-net-listen-invalid-port.js} (82%) rename test/parallel/{test-regress-GH-5927.js => test-tty-stdin-pipe.js} (94%) rename test/parallel/{test-regress-GH-6235.js => test-v8-global-setter.js} (87%) diff --git a/test/parallel/test-regress-GH-9819.js b/test/parallel/test-crypto-tostring-segfault.js similarity index 74% rename from test/parallel/test-regress-GH-9819.js rename to test/parallel/test-crypto-tostring-segfault.js index 7eed1c512f7942..b2c95117d3b1f8 100644 --- a/test/parallel/test-regress-GH-9819.js +++ b/test/parallel/test-crypto-tostring-segfault.js @@ -3,6 +3,11 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); +// This test ensures that node doesn't SEGFAULT when either of +// `crypto.createHash` or `crypto.createHmac` are given an object that defines +// a throwing `toString`. +// https://github.com/nodejs/node/issues/9819 + const assert = require('assert'); const execFile = require('child_process').execFile; diff --git a/test/parallel/test-regress-GH-5051.js b/test/parallel/test-http-addrequest-localaddress.js similarity index 85% rename from test/parallel/test-regress-GH-5051.js rename to test/parallel/test-http-addrequest-localaddress.js index 0fef879c6f15d5..fce53c88af3690 100644 --- a/test/parallel/test-regress-GH-5051.js +++ b/test/parallel/test-http-addrequest-localaddress.js @@ -1,5 +1,10 @@ 'use strict'; require('../common'); + +// This test ensures that `addRequest`'s Legacy API accepts `localAddress` +// correctly instead of accepting `path`. +// https://github.com/nodejs/node/issues/5051 + const assert = require('assert'); const agent = require('http').globalAgent; diff --git a/test/parallel/test-regress-GH-5727.js b/test/parallel/test-net-listen-invalid-port.js similarity index 82% rename from test/parallel/test-regress-GH-5727.js rename to test/parallel/test-net-listen-invalid-port.js index fab139ca7c305c..d07bc9fafa8f56 100644 --- a/test/parallel/test-regress-GH-5727.js +++ b/test/parallel/test-net-listen-invalid-port.js @@ -1,5 +1,10 @@ 'use strict'; const common = require('../common'); + +// This test ensures that port numbers are validated in *all* kinds of `listen` +// calls. If an invalid port is supplied, ensures a `RangeError` is thrown. +// https://github.com/nodejs/node/issues/5727 + const assert = require('assert'); const net = require('net'); diff --git a/test/parallel/test-regress-GH-5927.js b/test/parallel/test-tty-stdin-pipe.js similarity index 94% rename from test/parallel/test-regress-GH-5927.js rename to test/parallel/test-tty-stdin-pipe.js index f32dd61c978eb4..9e941532060384 100644 --- a/test/parallel/test-regress-GH-5927.js +++ b/test/parallel/test-tty-stdin-pipe.js @@ -21,6 +21,10 @@ 'use strict'; require('../common'); + +// This test ensures piping from `stdin` isn't broken. +// https://github.com/nodejs/node/issues/5927 + const assert = require('assert'); const readline = require('readline'); diff --git a/test/parallel/test-regress-GH-6235.js b/test/parallel/test-v8-global-setter.js similarity index 87% rename from test/parallel/test-regress-GH-6235.js rename to test/parallel/test-v8-global-setter.js index 484138ba2db007..1cb0898e61a5b4 100644 --- a/test/parallel/test-regress-GH-6235.js +++ b/test/parallel/test-v8-global-setter.js @@ -22,4 +22,8 @@ 'use strict'; require('../common'); +// This test ensures v8 correctly sets a property on the global object if it +// has a setter interceptor in strict mode. +// https://github.com/nodejs/node-v0.x-archive/issues/6235 + require('vm').runInNewContext('"use strict"; var v = 1; v = 2');