test setup

This commit is contained in:
kolaente 2022-08-14 11:42:33 +02:00
parent 4e0ee26673
commit d4c1b4f773
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 24 additions and 0 deletions

View File

@ -9,3 +9,7 @@ func FizzBuzz() {
fmt.Println(out)
}
}
func fizzOrBuzz(number int) string {
return ""
}

13
fizzbuzz_test.go Normal file
View File

@ -0,0 +1,13 @@
package main
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestFizzBuzz(t *testing.T) {
t.Run("number", func(t *testing.T) {
out := fizzOrBuzz(1)
assert.Equal(t, "1", out)
})
}

7
go.mod
View File

@ -1,3 +1,10 @@
module golang-intro
go 1.17
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/testify v1.8.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)