From 7eb69577a65d86eb2e16ad0d90cb1c3c9049aee9 Mon Sep 17 00:00:00 2001 From: James Halliday Date: Sat, 16 Mar 2013 12:15:44 -0700 Subject: [PATCH] another failing test for indexes --- test/buffer.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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); +}); -- 2.34.1