This commit is contained in:
scheibling
2025-04-08 19:24:11 +02:00
commit 30fb57f4f7
92 changed files with 6196 additions and 0 deletions

25
utils_test.go Normal file
View File

@@ -0,0 +1,25 @@
package woogo
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestToISOTimeString(t *testing.T) {
testCases := []struct {
tag string
date string
addMin bool
addMax bool
expected string
}{
{"min", "2020-01-01", true, false, "2020-01-01T00:00:00Z"},
{"has time", "2020-01-01 01:02:03", true, false, "2020-01-01T01:02:03Z"},
{"bad format", "2020-01-0101:02:03", true, false, "2020-01-0101:02:03"},
}
for _, testCase := range testCases {
s := ToISOTimeString(testCase.date, testCase.addMin, testCase.addMax)
assert.Equal(t, testCase.expected, s, testCase.tag)
}
}