Implemented echo example
This commit is contained in:
parent
fcc4f8d2d9
commit
86175d7a53
9 changed files with 70 additions and 58 deletions
|
@ -9,19 +9,20 @@ import (
|
|||
)
|
||||
|
||||
var examples = []struct {
|
||||
Name string
|
||||
ExpectedOutput string
|
||||
ExpectedExitCode int
|
||||
Name string
|
||||
Input string
|
||||
Output string
|
||||
ExitCode int
|
||||
}{
|
||||
{"hello", "Hello", 0},
|
||||
{"factorial", "", 120},
|
||||
{"fibonacci", "", 55},
|
||||
{"hello", "", "Hello", 0},
|
||||
{"factorial", "", "", 120},
|
||||
{"fibonacci", "", "", 55},
|
||||
}
|
||||
|
||||
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)
|
||||
run(t, filepath.Join("..", "examples", test.Name), test.Input, test.Output, test.ExitCode)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue