gowebdav/utils_test.go
Christoph Polcin d002be5074 add utils_test
2014-10-23 11:15:28 +02:00

19 lines
402 B
Go

package gowebdav
import "testing"
func TestJoin(t *testing.T) {
eq(t, "/", "", "")
eq(t, "/", "/", "/")
eq(t, "/foo", "", "/foo")
eq(t, "foo/foo", "foo/", "/foo")
eq(t, "foo/foo", "foo/", "foo")
}
func eq(t *testing.T, expected string, s0 string, s1 string) {
s := Join(s0, s1)
if s != expected {
t.Error("For", "'"+s0+"','" + s1+"'", "expeted", "'"+ expected + "'", "got", "'"+s+"'")
}
}