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

Function TestParseDATA

asm/parse_test.go:237–265  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

235}
236
237func TestParseDATA(t *testing.T) {
238 input := `
239 DATA R0, %foo
240 DATA R1,%bar
241 DATA R2, %baz
242 DATA R3,%BOO
243 DATA R0, %bee23
244 DATA R0, 0xFE85
245 DATA R1,0x2963
246 DATA R2, 0x000A
247 DATA R3,19
248 DATA R0, 0xf9fe
249 `
250
251 expected := []Instruction{
252 DATA{REG0, SYMBOL{"foo"}},
253 DATA{REG1, SYMBOL{"bar"}},
254 DATA{REG2, SYMBOL{"baz"}},
255 DATA{REG3, SYMBOL{"BOO"}},
256 DATA{REG0, SYMBOL{"bee23"}},
257 DATA{REG0, NUMBER{0xFE85}},
258 DATA{REG1, NUMBER{0x2963}},
259 DATA{REG2, NUMBER{0x000A}},
260 DATA{REG3, NUMBER{19}},
261 DATA{REG0, NUMBER{0xF9FE}},
262 }
263
264 testParseInstructions(input, expected, t)
265}
266
267func TestParseJMP(t *testing.T) {
268 input := `

Callers

nothing calls this directly

Calls 1

testParseInstructionsFunction · 0.85

Tested by

no test coverage detected