package nextcloud

import "testing"

func TestJoinBaseURL(t *testing.T) {
	base := "http://nextcloud:80"
	got := joinBaseURL(base, "remote.php/dav/calendars/user/personal/event.ics")
	want := "http://nextcloud:80/remote.php/dav/calendars/user/personal/event.ics"
	if got != want {
		t.Fatalf("joinBaseURL = %q, want %q", got, want)
	}
	got = joinBaseURL(base, "/remote.php/dav/calendars/user/personal/event.ics")
	if got != want {
		t.Fatalf("joinBaseURL with slash = %q, want %q", got, want)
	}
}
