]> zoso.dev Git - buffer.git/commitdiff
another failing test for indexes
authorJames Halliday <mail@substack.net>
Sat, 16 Mar 2013 19:15:44 +0000 (12:15 -0700)
committerJames Halliday <mail@substack.net>
Sat, 16 Mar 2013 19:15:44 +0000 (12:15 -0700)
test/buffer.js

index f0a3764f53ad92f91aa5e019ea660f1dabb41779..bbb0c5bffabeafa0d8cc99871192ce2b320339c2 100644 (file)
@@ -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);
+});