Skip to content

Commit

Permalink
Add loads test case
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Diamant <michaeldiamant@users.noreply.github.com>
  • Loading branch information
iten-alg and michaeldiamant committed Jun 9, 2022
1 parent 4654a1f commit f40fdf2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions data/transactions/logic/assembler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2409,6 +2409,8 @@ func TestScratchTypeCheck(t *testing.T) {
testProg(t, "byte 0x01; store 0; load 0; int 1; +", AssemblerMaxVersion, Expect{5, "+ arg 0..."})
// Loads should know the type it's loading if all the slots are the same type
testProg(t, "int 0; loads; btoi", AssemblerMaxVersion, Expect{3, "btoi arg 0..."})
// Loads doesn't know the type when slot types vary
testProg(t, "byte 0x01; store 0; int 1; loads; btoi", AssemblerMaxVersion)
// Stores should only set slots to StackAny if they are not the same type as what is being stored
testProg(t, "byte 0x01; store 0; int 3; byte 0x01; stores; load 0; int 1; +", AssemblerMaxVersion, Expect{8, "+ arg 0..."})
// ScratchSpace should reset after hitting label in deadcode
Expand Down

0 comments on commit f40fdf2

Please sign in to comment.