From 7880f8cc2108056503c6eae28d8531a076df9448 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 16 Nov 2015 16:18:21 -0800 Subject: [PATCH] add test for #83 --- test/basic.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/basic.js b/test/basic.js index f093f8e..20edcf0 100644 --- a/test/basic.js +++ b/test/basic.js @@ -70,4 +70,18 @@ test('storing negative number should cast to unsigned', function (t) { t.end() }) -// TODO: test write negative with +test('test that memory is copied from array-like', function (t) { + var u = new Uint8Array(4) + var b = new B(u) + b[0] = 1 + b[1] = 2 + b[2] = 3 + b[3] = 4 + + t.equal(u[0], 0) + t.equal(u[1], 0) + t.equal(u[2], 0) + t.equal(u[3], 0) + + t.end() +}) -- 2.34.1