Skip to content

Commit

Permalink
Fixed tests to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
RealA10N committed Feb 8, 2025
1 parent e832f8a commit dbe9986
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions gen/function_generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ func TestIfElseFunctionGeneration(t *testing.T) {
src := `func @toBool $32 %n {
JZ %n .zero
.nonzero
%bool = ADD $32 #1 $32 #0
$32 %bool = ADD $32 #1 $32 #0
JMP .end
.zero
%bool = ADD $32 #0 $32 #0
$32 %bool = ADD $32 #0 $32 #0
.end
RET
}`
Expand Down Expand Up @@ -135,7 +135,7 @@ func TestEmptyFunctionGeneration(t *testing.T) {

func TestNoReturnFunctionGeneration(t *testing.T) {
src := `func @noReturn {
%n = ADD $32 #1 $32 #2
$32 %n = ADD $32 #1 $32 #2
}`
function, results := generateFunctionFromSource(t, src)
assert.False(t, results.IsEmpty())
Expand Down
4 changes: 2 additions & 2 deletions gen/instruction_generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func (m *InstructionMap) GetInstructionDefinition(
}

func TestInstructionCreateTarget(t *testing.T) {
src := core.NewSourceView("%c = ADD %a %b\n")
src := core.NewSourceView("$32 %c = ADD %a %b\n")
tkns, err := lex.NewTokenizer().Tokenize(src)
assert.NoError(t, err)

Expand Down Expand Up @@ -221,5 +221,5 @@ func TestInstructionCreateTarget(t *testing.T) {
assert.NotNil(t, target)
assert.Equal(t, "%c", target.Name)
assert.Equal(t, intType, target.Type.Base)
assert.Equal(t, src.Unmanaged().Subview(0, 2), target.Declaration)
assert.Equal(t, src.Unmanaged().Subview(0, 6), target.Declaration)
}

0 comments on commit dbe9986

Please sign in to comment.