wip
This commit is contained in:
31
internal/load/load_test.go
Normal file
31
internal/load/load_test.go
Normal file
@@ -0,0 +1,31 @@
|
||||
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())
|
||||
}
|
||||
Reference in New Issue
Block a user