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

Function TestOneRegInstructionsString

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

Source from the content-addressed store, hash-verified

272}
273
274func TestOneRegInstructionsString(t *testing.T) {
275 var TABLE map[Instruction]string = map[Instruction]string{
276 SHR{REG0}: "SHR R0",
277 SHR{REG1}: "SHR R1",
278 SHR{REG2}: "SHR R2",
279 SHR{REG3}: "SHR R3",
280
281 SHL{REG0}: "SHL R0",
282 SHL{REG1}: "SHL R1",
283 SHL{REG2}: "SHL R2",
284 SHL{REG3}: "SHL R3",
285
286 NOT{REG0}: "NOT R0",
287 NOT{REG1}: "NOT R1",
288 NOT{REG2}: "NOT R2",
289 NOT{REG3}: "NOT R3",
290
291 JR{REG0}: "JR R0",
292 JR{REG1}: "JR R1",
293 JR{REG2}: "JR R2",
294 JR{REG3}: "JR R3",
295 }
296
297 for ins, expected := range TABLE {
298 if ins.String() != expected {
299 t.Logf("Expected %s got %s when testing %s", expected, ins.String(), ins)
300 t.FailNow()
301 }
302 }
303}
304
305func TestOneRegInstructions(t *testing.T) {
306 var TABLE map[Instruction][]uint16 = map[Instruction][]uint16{

Callers

nothing calls this directly

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected