aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test
diff options
context:
space:
mode:
authorRemco Bloemen <remco@wicked.ventures>2018-05-28 20:29:12 +0800
committerGreg Hysen <greg.hysen@gmail.com>2018-06-08 06:38:48 +0800
commit63014aeb6bdd3fb92452ebe69f08d9dcbbe2b502 (patch)
treed4af5fabdcc9b03ab246402225eb650183496f88 /packages/contracts/test
parent31e21db5b5c40a80b71bb411149bec3345cf17de (diff)
downloaddexon-sol-tools-63014aeb6bdd3fb92452ebe69f08d9dcbbe2b502.tar.gz
dexon-sol-tools-63014aeb6bdd3fb92452ebe69f08d9dcbbe2b502.tar.zst
dexon-sol-tools-63014aeb6bdd3fb92452ebe69f08d9dcbbe2b502.zip
Add tests for word loop iteration
Diffstat (limited to 'packages/contracts/test')
-rw-r--r--packages/contracts/test/libraries/lib_mem.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/contracts/test/libraries/lib_mem.ts b/packages/contracts/test/libraries/lib_mem.ts
index 0a2f69f61..225a8d60d 100644
--- a/packages/contracts/test/libraries/lib_mem.ts
+++ b/packages/contracts/test/libraries/lib_mem.ts
@@ -57,15 +57,17 @@ describe('LibMem', () => {
expect(result).to.deep.equal(expected);
}),
);
-
+
test([[0, 0, 0, 'copies zero bytes with overlap']]);
-
+
describe('copies forward', () => test([
[128, 0, 0, 'zero bytes'],
[128, 0, 1, 'one byte'],
[128, 0, 11, 'eleven bytes'],
[128, 0, 31, 'thirty-one bytes'],
[128, 0, 32, 'one word'],
+ [128, 0, 64, 'two words'],
+ [128, 0, 96, 'three words'],
[128, 0, 33, 'one word and one byte'],
[128, 0, 72, 'two words and eight bytes'],
[128, 0, 100, 'three words and four bytes'],
@@ -127,6 +129,8 @@ describe('LibMem', () => {
[0, 128, 11, 'eleven bytes'],
[0, 128, 31, 'thirty-one bytes'],
[0, 128, 32, 'one word'],
+ [0, 128, 64, 'two words'],
+ [0, 128, 96, 'three words'],
[0, 128, 33, 'one word and one byte'],
[0, 128, 72, 'two words and eight bytes'],
[0, 128, 100, 'three words and four bytes'],