Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
| 1 |
package load_test |
| 2 |
|
| 3 |
import ( |
| 4 |
"testing" |
| 5 |
|
| 6 |
"github.com/mmcloughlin/avo/internal/gen" |
| 7 |
"github.com/mmcloughlin/avo/internal/inst" |
| 8 |
"github.com/mmcloughlin/avo/internal/load" |
| 9 |
"github.com/mmcloughlin/avo/internal/test" |
| 10 |
"github.com/mmcloughlin/avo/printer" |
| 11 |
) |
| 12 |
|
| 13 |
func Load(t *testing.T) []inst.Instruction { |
| 14 |
t.Helper() |
| 15 |
l := load.NewLoaderFromDataDir("testdata") |
| 16 |
is, err := l.Load() |
| 17 |
if err != nil { |
| 18 |
t.Fatal(err) |
| 19 |
} |
| 20 |
return is |
| 21 |
} |
| 22 |
|
| 23 |
func TestAssembles(t *testing.T) { |
| 24 |
is := Load(t) |
| 25 |
g := gen.NewAsmTest(printer.NewArgvConfig()) |
| 26 |
b, err := g.Generate(is) |
| 27 |
if err != nil { |
| 28 |
t.Fatal(err) |
| 29 |
} |
| 30 |
test.Assembles(t, b) |
| 31 |
} |