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

Function TestParseDefSymbol

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

Source from the content-addressed store, hash-verified

30}
31
32func TestParseDefSymbol(t *testing.T) {
33 p := Parser{}
34
35 result, err := p.Parse(strings.NewReader(`
36 %counter = 0x0015
37 %foo = 91
38 %bar = 0x2198
39 %WOOHoo93 =0x104
40 `))
41
42 expected := []Instruction{
43 DEFSYMBOL{"counter", 0x0015},
44 DEFSYMBOL{"foo", 91},
45 DEFSYMBOL{"bar", 0x2198},
46 DEFSYMBOL{"WOOHoo93", 0x104},
47 }
48
49 if err != nil {
50 t.FailNow()
51 }
52
53 if result[0] != expected[0] {
54 t.FailNow()
55 }
56
57 if result[1] != expected[1] {
58 t.FailNow()
59 }
60}
61
62
63func TestParseCALL(t *testing.T) {

Callers

nothing calls this directly

Calls 1

ParseMethod · 0.95

Tested by

no test coverage detected