From: James Halliday Date: Sat, 16 Mar 2013 19:15:44 +0000 (-0700) Subject: another failing test for indexes X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=7eb69577a65d86eb2e16ad0d90cb1c3c9049aee9;p=buffer.git another failing test for indexes --- diff --git a/test/buffer.js b/test/buffer.js index f0a3764..bbb0c5b 100644 --- a/test/buffer.js +++ b/test/buffer.js @@ -217,10 +217,18 @@ test("fill", function(t) { t.end(); }); -test("[] indexes", function(t) { +test("indexes from a string", function(t) { t.plan(3); var buf = new buffer.Buffer('abc'); t.equal(buf[0], 97); t.equal(buf[1], 98); t.equal(buf[2], 99); }); + +test("indexes from an array", function(t) { + t.plan(3); + var buf = new buffer.Buffer([ 97, 98, 99 ]); + t.equal(buf[0], 97); + t.equal(buf[1], 98); + t.equal(buf[2], 99); +});