summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2016-10-19test: rename target to exports for consistencyDaniel Bevenius
The doc/api/addons.md document contains examples of Addon Initialization functions that take a parameter named exports. This also matches the name used in node.cc when calling: mp->nm_register_func(exports, module, mp->nm_priv); Currently, a number of the tests name this same parameter target. This commit renames target to exports for consistency. PR-URL: https://github.com/nodejs/node/pull/9135 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-10-19test: add regression test for `unpipe()`Niels Nielsen
Since 2e568d9 there is a bug where unpiping a stream from a readable stream that has `_readableState.pipesCount > 1` will cause it to remove the first stream in the `_.readableState.pipes` array no matter where in the list the `dest` stream was. PR-URL: https://github.com/nodejs/node/pull/9171 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
2016-10-19crypto: fix openssl.cnf FIPS handling & testingRod Vagg
* Add documentation for `--openssl-conf=file`. * Fix openssl.cnf loading and OpenSSL init ordering * Fix FIPS tests so `OPENSSL_CONF` is not longer usable but `--openssl-conf` is PR-URL: https://github.com/nodejs/node-private/pull/82 Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-10-19inspector: generate UUID for debug targetsEugene Ostroukhov
PR-URL: https://github.com/nodejs/node-private/pull/79 Fixes: https://github.com/nodejs/security/issues/81 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-10-18buffer: coerce slice parameters consistentlySakthipriyan Vairamani (thefourtheye)
As shown in https://github.com/nodejs/node/issues/9096, the offset and end value of the `slice` call are coerced to numbers and then passed to `FastBuffer`, which internally truncates the mantissa part if the number is actually a floating point number. This actually affects the new length of the slice calculation. For example, > const original = Buffer.from('abcd'); undefined > original.slice(original.length / 3).toString() 'bc' This happens because, starting value of the slice is 4 / 3, which is 1.33 (approximately). Now, the length of the slice is calculated as the difference between the actual length of the buffer and the starting offset. So, it becomes 2.67 (4 - 1.33). Now, a new `FastBuffer` is constructed, with the following values as parameters, 1. actual buffer object, 2. starting value, which is 1.33 and 3. the length 2.67. The underlying C++ code truncates the numbers and they become 1 and 2. That is why the result is just `bc`. This patch makes sure that all the offsets are coerced to integers before any calculations are done. Fixes: https://github.com/nodejs/node/issues/9096 PR-URL: https://github.com/nodejs/node/pull/9101 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
2016-10-18test: checking if error constructor is assert.AssertionErrorlarissayvette
PR-URL: https://github.com/nodejs/node/pull/9119 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2016-10-18test: remove unneeded escaping in template stringsRich Trott
The no-useless-escape rule in ESLint did not previously flag certain unnecessary escaping in template strings. These will be flagged in ESLint 3.8.0. PR-URL: https://github.com/nodejs/node/pull/9112 Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
2016-10-18test: remove unused common.libDirRich Trott
PR-URL: https://github.com/nodejs/node/pull/9124 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
2016-10-17test: fix flaky test-child-process-fork-dgramRich Trott
`test-child-process-fork-dgram` is unreliable on some platforms, especially FreeBSD and AIX within the project's continuous integration testing. It has also been observed to be flaky on macos. * Confirm child has received the server before sending packets * Close the server instance on the parent or child after receiving a Refs: https://github.com/nodejs/node/pull/8697 Fixes: https://github.com/nodejs/node/issues/8949 Fixes: https://github.com/nodejs/node/issues/8271 PR-URL: https://github.com/nodejs/node/pull/9098 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2016-10-17crypto: fix faulty logic in iv size checkBen Noordhuis
Fix a regression introduced in commit 2996b5c ("crypto: Allow GCM ciphers to have a longer IV length") from April 2016 where a misplaced parenthesis in a 'is ECB cipher?' check made it possible to use empty IVs with non-ECB ciphers. Also fix some exit bugs in test/parallel/test-crypto-authenticated.js that were introduced in commit 4a40832 ("test: cleanup IIFE tests") where removing the IFFEs made the test exit prematurely instead of just skipping subtests. PR-URL: https://github.com/nodejs/node/pull/9032 Refs: https://github.com/nodejs/node/pull/6376 Refs: https://github.com/nodejs/node/issues/9024 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
2016-10-17test: use npm sandbox in test-npm-installJoão Reis
npm should run in a sandbox to avoid unwanted interactions. Without this change, npm would read the userconfig file $HOME/.npmrc which may contain configs that break this test. Fixes: https://github.com/nodejs/node/issues/9074 PR-URL: https://github.com/nodejs/node/pull/9079 Reviewed-By: Jeremiah Senkpiel <Fishrock123@rocketmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-10-17test: enable node-module-version/test.js with debugDaniel Bevenius
Commit fdca79fbc0a797206fa690d51b8844ed4fd596d6 ("test: enable addons test to pass with debug build") enabled the addons tests to pass when the build type is of type debug (configure --debug). test/addons/node-module-version/test.js was recently added and expects the the build type to be of type Release (like most of the others until recently). This commit allows this test to pass when the build type if of type debug. PR-URL: https://github.com/nodejs/node/pull/9093 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2016-10-14stream: fix `Writable` subclass instanceof checksAnna Henningsen
2a4b068acaa160 introduced a regression in where checking `instanceof` would fail for `Writable` subclasses inside the subclass constructor, i.e. before `Writable()` was called. Also, calling `null instanceof Writable` or `undefined instanceof Writable` would fail due to accessing the `_writableState` property of the target object. This fixes these problems. PR-URL: https://github.com/nodejs/node/pull/9088 Ref: https://github.com/nodejs/node/pull/8834#issuecomment-253640692 Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com>
2016-10-14timers: fix regression with clearImmediate()Brian White
This commit fixes a regression introduced in 0ed8839a27 that caused additional queued immediate callbacks to be ignored if `clearImmediate(immediate)` was called within the callback for `immediate`. PR-URL: https://github.com/nodejs/node/pull/9086 Fixes: https://github.com/nodejs/node/issues/9084 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com>
2016-10-14net: fix ambiguity in EOF handlingFedor Indutny
`end` MUST always be emitted **before** `close`. However, if a handle will invoke `uv_close_cb` immediately, or in the same JS tick - `close` may be emitted first. PR-URL: https://github.com/nodejs/node/pull/9066 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
2016-10-13test: move module out of fixture directoryRich Trott
tick-processor-base.js is a module used by three other tests. It is not a test fixture so move it out of the fixture directory. (One downside to having it in the fixture directory is that fixture code is not currently linted.) It is possible that the code in tick-processor-base.js should be integrated into common.js. This can potentially happen subsequently (and might make a reasonable good first contribution for a new contributor). PR-URL: https://github.com/nodejs/node/pull/9022 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-10-13test: fix issues reported by CoverityEugene Ostroukhov
Wrapped the timer into class to ensure it is cleaned up properly. PR-URL: https://github.com/nodejs/node/pull/8870 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-10-13test: refactor test-file-*Jenna Vuong
* var to const * add check that expected error is ENOENT * indexOf() to includes() PR-URL: https://github.com/nodejs/node/pull/8999 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2016-10-13http: reject control characters in http.request()Ben Noordhuis
Unsanitized paths containing line feed characters can be used for header injection and request splitting so reject them with an exception. There seems to be no reasonable use case for allowing control characters (characters <= 31) while there are several scenarios where they can be used to exploit software bugs so reject control characters altogether. PR-URL: https://github.com/nodejs/node/pull/8923 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: not-an-aardvark <not-an-aardvark@users.noreply.github.com>
2016-10-12test: fixes that do not affect performancelarissayvette
PR-URL: https://github.com/nodejs/node/pull/9011 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2016-10-11url: adding WHATWG URL supportJames M Snell
Implements WHATWG URL support. Example: ``` var u = new url.URL('http://example.org'); ``` Currently passing all WHATWG url parsing tests and all but two of the setter tests. The two setter tests are intentionally skipped for now but will be revisited. PR-URL: https://github.com/nodejs/node/pull/7448 Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
2016-10-10buffer: make byteLength throw on invalid inputBrian White
PR-URL: https://github.com/nodejs/node/pull/8946 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-10-10test: add coverage for spawnSync() killSignalcjihrig
This commit adds a test for the killSignal option to spawnSync(), and the other sync child process functions by extension. PR-URL: https://github.com/nodejs/node/pull/8960 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-10-10test: refactor `assert` in internet test-dns.jsJunshu Okamoto
change assert.equal() to assert.strictEqual() and use assert.strictEqual() for type validation PR-URL: https://github.com/nodejs/node/pull/8980 Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2016-10-10fs: make `SyncWriteStream` inherit from `Writable`Anna Henningsen
Make the internal `SyncWriteStream` a proper `stream.Writable` subclass. This allows for quite a bit of simplification, since `SyncWriteStream` predates the streams2/streams3 implementations. Fixes: https://github.com/nodejs/node/issues/8828 PR-URL: https://github.com/nodejs/node/pull/8830 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2016-10-10stream: proper `instanceof` for `Writable`sAnna Henningsen
Use `[Symbol.hasInstance]()` to return `true` when asking for `new Duplex() instanceof Writable`. PR-URL: https://github.com/nodejs/node/pull/8834 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Calvin Metcalf <calvin.metcalf@gmail.com>
2016-10-10src: update module version mismatch error messageJames M Snell
Fixes: https://github.com/nodejs/node/issues/8379 PR-URL: https://github.com/nodejs/node/pull/8391 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2016-10-10test: various test improvementsJames M Snell
* Favor strictEqual * Use const where appropriate * Modernize where possible PR-URL: https://github.com/nodejs/node/pull/8468 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2016-10-10test: add cluster inspector debug port testcjihrig
This commit adds a test for the debug port value in cluster workers using the inspector debugger. Refs: https://github.com/nodejs/node/issues/8201 Refs: https://github.com/nodejs/node/pull/8386 Refs: https://github.com/nodejs/node/pull/8550 PR-URL: https://github.com/nodejs/node/pull/8958 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
2016-10-10tls: TLSSocket emits 'error' on handshake failureMariusz 'koder' Chwalba
Removes branch that would make TLSSocket emit '_tlsError' event if error occured on handshake and control was not released, as it was never happening. Addedd test for tls.Server to ensure it still emits 'tlsClientError' as expected. Fixes: https://github.com/nodejs/node/issues/8803 PR-URL: https://github.com/nodejs/node/pull/8805 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com>
2016-10-09fs: don't alter user provided `options` objectSakthipriyan Vairamani (thefourtheye)
This patch makes a copy of the `options` object before the fs module functions alter it. PR-URL: https://github.com/nodejs/node/pull/7831 Fixes: https://github.com/nodejs/node/pull/7655 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Nicu Micleușanu <micnic90@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
2016-10-08test: expand test coverage for url.jsJunshu Okamoto
Add url example with more than 255 characters in the hostname of the url. PR-URL: https://github.com/nodejs/node/pull/8976 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-10-08test: fix test-child-process-fork-regr-gh-2847Santiago Gimeno
It's not guaranteed that the first socket that tries to connect is the first that succeeds so the rest of assumptions made in the test are not correct. Fix it by making sure the second socket does not try to connect until the first has succeeded. The IPC channel can already be closed when sending the second socket. It should be allowed. Also, don't start sending messages until the worker is online. Fixes: https://github.com/nodejs/node/issues/8950 PR-URL: https://github.com/nodejs/node/pull/8954 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-10-07intl: add deprecation warning for v8BreakIteratorMichaël Zasso
Fixes: https://github.com/nodejs/node/issues/8865 PR-URL: https://github.com/nodejs/node/pull/8908 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-10-07buffer: fix check for `.buffer` propertyOjas Shirekar
isSharedArrayBuffer in fromObject was missing obj.buffer moved the 'length' in obj check so that it is checked first making the code slightly more performant and able to handle SharedArrayBuffer without relying on an explicit check. Ref: https://github.com/nodejs/node/pull/8510 PR-URL: https://github.com/nodejs/node/pull/8739 Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-10-06test: remove FIXME pummel/test-tls-securepair-clientAlfred Cepeda
Reverts: 85827bd Using `common.PORT` no longer causes other tests to fail Refs: https://github.com/nodejs/node/issues/4640 PR-URL: https://github.com/nodejs/node/pull/8757 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2016-10-06test: run faster and cleanup after runWyatt Preul
PR-URL: https://github.com/nodejs/node/pull/8848 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Matthew Loring <mattloring@google.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
2016-10-06test: refactor test-net-server-max-connectionsRich Trott
The test timed out on Windows in CI. Made the following changes: * reduced total connections from 200 to 20 * var -> const * string concatenation -> templates * assert.equal -> assert.strictEqual PR-URL: https://github.com/nodejs/node/pull/8931 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2016-10-06test: enable addons test to pass with debug buildDaniel Bevenius
Currently when running configure with the --debug option in combination with the tests (./configure --debug && make -j8 test) there are a few addon tests that fail with error messages similar to this: === release test === Path: addons/load-long-path/test fs.js:558 return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); ^ Error: ENOENT: no such file or directory, open '/nodejs/node/test/addons/load-long-path/build/Release/binding.node' at Object.fs.openSync (fs.js:558:18) at Object.fs.readFileSync (fs.js:468:33) at Object.<anonymous> (/nodejs/node/test/addons/load-long-path/test.js:28:19) at Module._compile (module.js:560:32) at Object.Module._extensions..js (module.js:569:10) at Module.load (module.js:477:32) at tryModuleLoad (module.js:436:12) at Function.Module._load (module.js:428:3) at Module.runMain (module.js:594:10) at run (bootstrap_node.js:382:7) Command: out/Release/node /nodejs/node/test/addons/load-long-path/test.js This commit allows for the tests to pass even if the configured build type is of type debug. PR-URL: https://github.com/nodejs/node/pull/8836 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-10-05test: remove blank lines at end of filesRich Trott
In preparation for a lint rule that disallows empty lines at the end of a file, remove such lines from a number of test files. Refs: https://github.com/nodejs/node/issues/8918 PR-URL: https://github.com/nodejs/node/pull/8920 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-10-06fs: refactor "options" processing as a functionSakthipriyan Vairamani
As it is, the "options" processing is repeated in all the functions which need it. That introduces checks which are inconsistent with other functions and produces slightly different error messages. This patch moves the basic "options" validation and processing to a seperate function. PR-URL: https://github.com/nodejs/node/pull/7165 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Nicu Micleușanu <micnic90@gmail.com> Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-10-05test: refactor test-file-write-streamSudaraka Wijesinghe
Replace all `var` occurrences in test-file-write-stream.js with `const` (where they are not being reassigned) and `let` (where they are being reassigned). Add strict comparison to the asserts and if statements: - Replace `assert.equal` with `assert.strictEqual` where: 1. Result of `typeof` being compared to a string literal. 2. Result of `fs.readFileSync` with UTF-8 encoding being compared to a string constant. - Replace `==` with `===` where integer values are being compared to integer literals. Remove unnecessary very IIFE. Use template literals. PR-URL: https://github.com/nodejs/node/pull/8894 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-10-05test: cleanup/update test-dgram-empty-packet.jsMichael Macherey
* Changed some `var` to `const` and 'let' * Changed `==` to `===` for clarity. PR-URL: https://github.com/nodejs/node/pull/8896 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-10-04test: fix child-process-uid-gid on WindowsMichaël Zasso
The process.getuid method does not exist on this platform. Ref: https://github.com/nodejs/node/pull/8864 PR-URL: https://github.com/nodejs/node/pull/8924 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Wyatt Preul <wpreul@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-10-04test: mark test-tick-processor-unknown flakyRich Trott
Mark test-tick-processor-unknown flaky on SmartOS. PR-URL: https://github.com/nodejs/node/pull/8900 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2016-10-04src: fix build for older clangZach Bjornson
Removes use of builtins that are unavailable for older clang. Per benchmarks, only uses builtins on Windows, where speedup is significant. Also adds test for unaligned ucs2 buffer write. Between #3410 and #7645, bytes were swapped twice on bigendian platforms if buffer was not two-byte aligned. See comment in #7645. PR-URL: https://github.com/nodejs/node/pull/7645 Fixes: https://github.com/nodejs/node/issues/7618 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-10-03doc: add documentation for test common modulePaul Grock
Alphabetized list of methods and properties for the common.js module. Add table of contents to the top of the readme. PR-URL: https://github.com/nodejs/node/pull/8840 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-10-03test: fix -Wformat warnings in inspector cctestBen Noordhuis
Print size_t and ssize_t using %zd and %zu respectively, not %ld. PR-URL: https://github.com/nodejs/node/pull/8034 Reviewed-By: James M Snell <jasnell@gmail.com>
2016-10-03test: fix running child-process-uid-gid as rootWyatt Preul
This skips the child-test-uid-gid test when run as root. Previously, the test failed if executed as root. PR-URL: https://github.com/nodejs/node/pull/8864 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
2016-10-03test: expand test coverage for url.jsJunshu Okamoto
Currently, line 156 of lib/url.js is not reachable from test-url because there is no example URL which has a white space in the front of the url. I added one example which can reach that line. PR-URL: https://github.com/nodejs/node/pull/8859 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com> Reviewed-By: Franziska Hinkelmann <fhinkel@vt.edu>