24 lines
420 B
Go
24 lines
420 B
Go
package tests_test
|
|
|
|
import (
|
|
"path/filepath"
|
|
"testing"
|
|
)
|
|
|
|
var examples = []struct {
|
|
Name string
|
|
ExpectedOutput string
|
|
ExpectedExitCode int
|
|
}{
|
|
{"hello", "", 9},
|
|
{"write", "ELF", 0},
|
|
}
|
|
|
|
func TestExamples(t *testing.T) {
|
|
for _, test := range examples {
|
|
t.Run(test.Name, func(t *testing.T) {
|
|
run(t, filepath.Join("..", "examples", test.Name), test.ExpectedOutput, test.ExpectedExitCode)
|
|
})
|
|
}
|
|
}
|