refactor: rename directory

This commit is contained in:
kbwo 2024-07-15 19:13:19 +09:00
parent 4782784122
commit 1d6dd6623e
41 changed files with 54 additions and 67 deletions

49
demo/go/cases_test.go Normal file
View file

@ -0,0 +1,49 @@
package main
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestSubtract(t *testing.T) {
testCases := []struct {
desc string
a int
b int
want int
}{
{
desc: "test one",
a: 1,
b: 2,
want: 3,
},
{
desc: "test two",
a: 1,
b: 2,
want: 7,
},
}
for _, tC := range testCases {
t.Run(tC.desc, func(t *testing.T) {
assert.Equal(t, tC.want, subtract(tC.a, tC.b))
})
}
}
func TestAdd(t *testing.T) {
t.Run("test one", func(t *testing.T) {
assert.Equal(t, 3, add(1, 2))
})
t.Run("test two", func(t *testing.T) {
assert.Equal(t, 5, add(1, 2))
})
variable := "string"
t.Run(variable, func(t *testing.T) {
assert.Equal(t, 3, add(1, 2))
})
}