Initial commit
This commit is contained in:
19
main_test.go
Normal file
19
main_test.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestEcho(t *testing.T) {
|
||||
// Test happy path
|
||||
err := echo([]string{"bin-name", "hello", "world!"})
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func TestEchoErrorNoArgs(t *testing.T) {
|
||||
// Test empty arguments
|
||||
err := echo([]string{})
|
||||
require.Error(t, err)
|
||||
}
|
||||
Reference in New Issue
Block a user