Files
avo/internal/load/load_test.go
Michael McLoughlin 59e6af7d36 wip
2018-11-21 13:02:18 -06:00

32 lines
553 B
Go

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())
}