MCPcopy Create free account
hub / github.com/djhworld/simple-computer / TestDATAInstructionsString

Function TestDATAInstructionsString

asm/instructions_test.go:341–359  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

339}
340
341func TestDATAInstructionsString(t *testing.T) {
342 var TABLE map[Instruction]string = map[Instruction]string{
343 DATA{REG0, NUMBER{0x0001}}: "DATA R0, 0x0001",
344 DATA{REG1, NUMBER{0x0002}}: "DATA R1, 0x0002",
345 DATA{REG2, NUMBER{0x0003}}: "DATA R2, 0x0003",
346 DATA{REG3, NUMBER{0x0004}}: "DATA R3, 0x0004",
347 DATA{REG0, SYMBOL{"aaa"}}: "DATA R0, %aaa",
348 DATA{REG1, SYMBOL{"bbb"}}: "DATA R1, %bbb",
349 DATA{REG2, SYMBOL{"ccc"}}: "DATA R2, %ccc",
350 DATA{REG3, SYMBOL{"ddd"}}: "DATA R3, %ddd",
351 }
352
353 for ins, expected := range TABLE {
354 if ins.String() != expected {
355 t.Logf("Expected %s got %s when testing %s", expected, ins.String(), ins)
356 t.FailNow()
357 }
358 }
359}
360
361func TestDATAInstruction(t *testing.T) {
362 var TABLE map[Instruction][]uint16 = map[Instruction][]uint16{

Callers

nothing calls this directly

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected