Refactored code structure
This commit is contained in:
23
tests/examples_test.go
Normal file
23
tests/examples_test.go
Normal file
@ -0,0 +1,23 @@
|
||||
package tests_test
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestExamples(t *testing.T) {
|
||||
var tests = []struct {
|
||||
Name string
|
||||
ExpectedOutput string
|
||||
ExpectedExitCode int
|
||||
}{
|
||||
{"hello", "", 9},
|
||||
{"write", "ELF", 0},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run(test.Name, func(t *testing.T) {
|
||||
run(t, filepath.Join("..", "examples", test.Name), test.ExpectedOutput, test.ExpectedExitCode)
|
||||
})
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user