Skip to content

Commit

Permalink
Make String() exported.
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanmorgan committed May 30, 2024
1 parent e5ae801 commit d57dec3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions parser/instruction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var opName = map[Opcode]string{
opMulVal: "mul",
}

func (inst Instruction) string() string {
func (inst Instruction) String() string {
return fmt.Sprintf("%s:%v", opName[inst.operator], inst.operand)
}

Expand All @@ -39,7 +39,7 @@ func TestNewInstruction(t *testing.T) {
}

for idx, val := range []byte(sourceCode) {
t.Run(program[idx].string(), func(t *testing.T) {
t.Run(program[idx].String(), func(t *testing.T) {
got := NewInstruction(val)
want := program[idx]

Expand Down Expand Up @@ -76,7 +76,7 @@ func TestIsZeroOp(t *testing.T) {

for idx, val := range program {
if want[idx] != val.IsZeroOp() {
t.Errorf("testing %v got %v want %v", val.string(), val.IsZeroOp(), want[idx])
t.Errorf("testing %v got %v want %v", val, val.IsZeroOp(), want[idx])
}
}
}
Expand Down

0 comments on commit d57dec3

Please sign in to comment.