Implemented echo example

This commit is contained in:
Eduard Urbach 2024-07-18 21:10:27 +02:00
parent fcc4f8d2d9
commit 86175d7a53
Signed by: eduard
GPG key ID: 49226B848C78F6C8
9 changed files with 70 additions and 58 deletions

View file

@ -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)
})
}
}