Implemented echo example

This commit is contained in:
2024-07-18 21:10:27 +02:00
parent b34470a97d
commit 824efbf424
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)
})
}
}