goext/langext/array_test.go
Mike Schwörer d2bb362135
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 3m39s
v0.0.465
2024-06-03 09:39:57 +02:00

24 lines
444 B
Go

package langext
import (
"gogs.mikescher.com/BlackForestBytes/goext/tst"
"strings"
"testing"
)
func TestJoinString(t *testing.T) {
ids := []string{"1", "2", "3"}
res := JoinString(ids, ",")
tst.AssertEqual(t, res, "1,2,3")
}
func TestArrPrepend(t *testing.T) {
v1 := []string{"1", "2", "3"}
v2 := ArrPrepend(v1, "4", "5", "6")
tst.AssertEqual(t, strings.Join(v1, ""), "123")
tst.AssertEqual(t, strings.Join(v2, ""), "654123")
}