From 39cfebd6f8b8e0579fe668693c9b2e13b9946b2f Mon Sep 17 00:00:00 2001 From: TonyYang Date: Fri, 9 Sep 2016 10:57:16 +0800 Subject: [PATCH 1/2] Clean up url tests and wrap in namespace --- node/node-4-tests.ts | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/node/node-4-tests.ts b/node/node-4-tests.ts index 348723ea6e0815..803e38cfd9d485 100644 --- a/node/node-4-tests.ts +++ b/node/node-4-tests.ts @@ -249,18 +249,24 @@ function bufferTests() { /// Url tests : http://nodejs.org/api/url.html //////////////////////////////////////////////////// -url.format(url.parse('http://www.example.com/xyz')); - -// https://google.com/search?q=you're%20a%20lizard%2C%20gary -url.format({ - protocol: 'https', - host: "google.com", - pathname: 'search', - query: { q: "you're a lizard, gary" } -}); +namespace url_tests { + { + url.format(url.parse('http://www.example.com/xyz')); + + // https://google.com/search?q=you're%20a%20lizard%2C%20gary + url.format({ + protocol: 'https', + host: "google.com", + pathname: 'search', + query: { q: "you're a lizard, gary" } + }); + } -var helloUrl = url.parse('http://example.com/?hello=world', true) -assert.equal(helloUrl.query.hello, 'world'); + { + var helloUrl = url.parse('http://example.com/?hello=world', true) + assert.equal(helloUrl.query.hello, 'world'); + } +} ///////////////////////////////////////////////////// /// util tests : https://nodejs.org/api/util.html /// From 1845c1fba09ed653e49043b8b79b32d714c1e288 Mon Sep 17 00:00:00 2001 From: TonyYang Date: Fri, 9 Sep 2016 10:59:14 +0800 Subject: [PATCH 2/2] Clean up url tests and wrap in namespace --- node/node-tests.ts | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/node/node-tests.ts b/node/node-tests.ts index 28a015468cdb7f..92d149a949db65 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -360,18 +360,24 @@ function bufferTests() { /// Url tests : http://nodejs.org/api/url.html //////////////////////////////////////////////////// -url.format(url.parse('http://www.example.com/xyz')); - -// https://google.com/search?q=you're%20a%20lizard%2C%20gary -url.format({ - protocol: 'https', - host: "google.com", - pathname: 'search', - query: { q: "you're a lizard, gary" } -}); +namespace url_tests { + { + url.format(url.parse('http://www.example.com/xyz')); + + // https://google.com/search?q=you're%20a%20lizard%2C%20gary + url.format({ + protocol: 'https', + host: "google.com", + pathname: 'search', + query: { q: "you're a lizard, gary" } + }); + } -var helloUrl = url.parse('http://example.com/?hello=world', true) -assert.equal(helloUrl.query.hello, 'world'); + { + var helloUrl = url.parse('http://example.com/?hello=world', true) + assert.equal(helloUrl.query.hello, 'world'); + } +} ///////////////////////////////////////////////////// /// util tests : https://nodejs.org/api/util.html ///