Files
avo/internal/load/load_test.go

32 lines
553 B
Go
Raw Normal View History

2018-11-21 13:02:18 -06:00
package load_test
import (
"bytes"
"testing"
"github.com/mmcloughlin/avo/internal/gen"
"github.com/mmcloughlin/avo/internal/inst"
"github.com/mmcloughlin/avo/internal/load"
"github.com/mmcloughlin/avo/internal/test"
)
func Load(t *testing.T) []*inst.Instruction {
t.Helper()
l := load.NewLoaderFromDataDir("testdata")
is, err := l.Load()
if err != nil {
t.Fatal(err)
}
return is
}
func TestAssembles(t *testing.T) {
is := Load(t)
g := &gen.LoaderTest{}
var buf bytes.Buffer
g.Generate(&buf, is)
test.Assembles(t, buf.Bytes())
}