Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
acolytec3 committed Dec 15, 2022
1 parent eae1ccf commit 4e88e1d
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions packages/evm/test/memory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ tape('Memory', (t) => {
})

t.test(
'should expand by word (32 bytes) properly when writing to previously untouched location',
'should expand by container (8192 bytes) properly when writing to previously untouched location',
(st) => {
const memory = new Memory()
st.equal(memory._store.length, 0, 'memory should start with zero length')
Expand All @@ -48,23 +48,17 @@ tape('Memory', (t) => {
}
)

t.test('should expand by word (32 bytes) when reading a previously untouched location', (st) => {
const memory = new Memory()
memory.read(0, 8)
st.equal(memory._store.length, 8192)

memory.read(1, 16)
st.equal(memory._store.length, 8192)

memory.read(1, 32)
st.equal(memory._store.length, 8192)

memory.read(32, 32)
st.equal(memory._store.length, 8192)
t.test(
'should expand by container (8192 bytes) when reading a previously untouched location',
(st) => {
const memory = new Memory()
memory.read(0, 8)
st.equal(memory._store.length, 8192)

memory.read(33, 32)
st.equal(memory._store.length, 8192)
memory.read(8190, 8193)
st.equal(memory._store.length, 16384)

st.end()
})
st.end()
}
)
})

0 comments on commit 4e88e1d

Please sign in to comment.