From 2d36150852622429e19409fdcdef448f418b2d3a Mon Sep 17 00:00:00 2001 From: Masashi Hirano Date: Fri, 1 Jun 2018 23:02:13 +0900 Subject: [PATCH] test: string-decorater.lastChar Added test for string-decorater.lastChar to improve coverage. PR-URL: https://github.com/nodejs/node/pull/21084 Reviewed-By: Tiancheng "Timothy" Gu Reviewed-By: Lance Ball Reviewed-By: Trivikram Kamat --- test/parallel/test-string-decoder.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-string-decoder.js b/test/parallel/test-string-decoder.js index 0e7ea8ffdd56a6..fafab97b2d3888 100644 --- a/test/parallel/test-string-decoder.js +++ b/test/parallel/test-string-decoder.js @@ -90,7 +90,8 @@ test('utf16le', Buffer.from('3DD84DDC', 'hex'), '\ud83d\udc4d'); // thumbs up decoder = new StringDecoder('utf8'); assert.strictEqual(decoder.write(Buffer.from('E1', 'hex')), ''); -// A quick test for lastNeed & lastTotal which are undocumented. +// A quick test for lastChar, lastNeed & lastTotal which are undocumented. +assert(decoder.lastChar.equals(new Uint8Array([0xe1, 0, 0, 0]))); assert.strictEqual(decoder.lastNeed, 2); assert.strictEqual(decoder.lastTotal, 3);