summaryrefslogtreecommitdiff
path: root/test/parallel/test-string-decoder-end.js
Commit message (Collapse)AuthorAgeFilesLines
* test: remove the third string literal argument from assert.strictEqual()Kevin Thomas2018-06-201-2/+4
| | | | | | | | | | | | | Third string literal argument in assert.strictEqual() needs to be removed. Otherwise, on AssertionError it would not display the values that failed the check -- this hinders debugging. The string literals are added as comments above the check. PR-URL: https://github.com/nodejs/node/pull/21406 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* string_decoder: reset decoder on endJustin Ridgewell2018-02-021-0/+51
| | | | | | | | | | | | | | This resets the StringDecoder's state after calling `#end`. Further writes to the decoder will act as if it were a brand new instance, allowing simple reuse. PR-URL: https://github.com/nodejs/node/pull/18494 Fixes: https://github.com/nodejs/node/issues/16564 Refs: https://github.com/nodejs/node/pull/16594 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* meta: restore original copyright headerJames M Snell2017-03-101-0/+21
| | | | | | | | | | | | | | | A prior io.js era commit inappropriately removed the original copyright statements from the source. This restores those in any files still remaining from that edit. Ref: https://github.com/nodejs/TSC/issues/174 Ref: https://github.com/nodejs/node/pull/10599 PR-URL: https://github.com/nodejs/node/pull/10155 Note: This PR was required, reviewed-by and approved by the Node.js Foundation Legal Committee and the TSC. There is no `Approved-By:` meta data.
* test: use repeat() instead of new Array().join()Jackson Tian2017-02-011-1/+1
| | | | | | | | | | | | | | The usage of `new Array(length + 1).join(str)` is strange. Change to `str.repeat(length)` is more clearly. PR-URL: https://github.com/nodejs/node/pull/11071 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
* string_decoder: align UTF-8 handling with V8Brian White2017-01-261-7/+0
| | | | | | | | | | | | | | | V8 5.5 changed how invalid characters are handled and it now appears to follow the WHATWG Encoding standard, where all of an invalid character's bytes are replaced by a single replacement character (\ufffd) instead of replacing each invalid byte with separate replacement characters. Example: the byte sequence 0xF0,0xB8,0x41 is decoded as '\ufffdA' in V8 5.5, but is decoded as '\ufffd\ufffdA' in previous versions of V8. PR-URL: https://github.com/nodejs/node/pull/9618 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* test: increase coverage of string-decoderabouthiroppy2017-01-211-7/+3
| | | | | | | | | | | | | Make use of Arrow Function. Add normalizeencoding's test. normalizeEncoding: https://github.com/nodejs/node/blob/master/lib/string_decoder.js#L9 PR-URL: https://github.com/nodejs/node/pull/10863 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* test: s/assert.equal/assert.strictEqual/Gibson Fahnestock2017-01-111-2/+2
| | | | | | | | | | | | | Use assert.strictEqual instead of assert.equal in tests, manually convert types where necessary. PR-URL: https://github.com/nodejs/node/pull/10698 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
* test: use eslint to fix var->const/letGibson Fahnestock2017-01-111-9/+9
| | | | | | | | | Manually fix issues that eslint --fix couldn't do automatically. PR-URL: https://github.com/nodejs/node/pull/10685 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
* test: use const for all require() callscjihrig2017-01-021-2/+2
| | | | | PR-URL: https://github.com/nodejs/node/pull/10550 Reviewed-By: Rich Trott <rtrott@gmail.com>
* string_decoder: rewrite implementationBrian White2016-05-291-0/+2
| | | | | | | | | | | | | | This commit provides a rewrite of StringDecoder that both improves performance (for non-single-byte encodings) and understandability. Additionally, StringDecoder instantiation performance has increased considerably due to inlinability and more efficient encoding name checking. PR-URL: https://github.com/nodejs/node/pull/6777 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* buffer: add .from(), .alloc() and .allocUnsafe()James M Snell2016-03-161-2/+2
| | | | | | | | | | | | | | | Several changes: * Soft-Deprecate Buffer() constructors * Add `Buffer.from()`, `Buffer.alloc()`, and `Buffer.allocUnsafe()` * Add `--zero-fill-buffers` command line option * Add byteOffset and length to `new Buffer(arrayBuffer)` constructor * buffer.fill('') previously had no effect, now zero-fills * Update the docs PR-URL: https://github.com/nodejs/node/pull/4682 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
* test: fix variable redeclarationsRich Trott2016-02-021-1/+1
| | | | | | | | | | I'm a fan of small changesets, but even I'm getting a little annoyed at me for opening all these PRs weeding out variable redeclarations. So I'm bundling a bunch of small changes here. PR-URL: https://github.com/nodejs/node/pull/4992 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: load common.js to test for global leaksRich Trott2015-10-011-0/+1
| | | | | | | | | | common.js contains code that checks for variables leaking into the global namespace. Load common.js in all tests that do not intentionally leak variables. PR-URL: https://github.com/nodejs/node/pull/3095 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
* test: enable linting for testsRoman Reiss2015-05-191-0/+1
| | | | | | | | | | | | Enable linting for the test directory. A number of changes was made so all tests conform the current rules used by lib and src directories. The only exception for tests is that unreachable (dead) code is allowed. test-fs-non-number-arguments-throw had to be excluded from the changes because of a weird issue on Windows CI. PR-URL: https://github.com/nodejs/io.js/pull/1721 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* Remove excessive copyright/license boilerplateisaacs2015-01-121-21/+0
| | | | | | | The copyright and license notice is already in the LICENSE file. There is no justifiable reason to also require that it be included in every file, since the individual files are not individually distributed except as part of the entire package.
* test: split test in parallel/sequentialFedor Indutny2014-12-171-0/+75
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> PR-URL: https://github.com/iojs/io.js/pull/172 Fix: iojs/io.js#139