Skip to content

Commit

Permalink
Added value test to immediate argument
Browse files Browse the repository at this point in the history
  • Loading branch information
RealA10N committed Dec 3, 2024
1 parent b1852e1 commit 5b39141
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gen/immediate_arugment_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package gen_test

import (
"math/big"
"testing"

"alon.kr/x/usm/core"
Expand Down Expand Up @@ -32,6 +33,12 @@ func TestImmediateValueArgument(t *testing.T) {
}

generator := gen.ImmediateArgumentGenerator[Instruction]{}
_, results := generator.Generate(&ctx, node)
argument, results := generator.Generate(&ctx, node)

assert.True(t, results.IsEmpty())
assert.Equal(t, intType, argument.GetType())

immediateArgument, ok := argument.(*gen.ImmediateInfo)
assert.True(t, ok)
assert.Zero(t, immediateArgument.Value.Cmp(big.NewInt(1337)))
}

0 comments on commit 5b39141

Please sign in to comment.