ultisuite-backend/internal/nextcloud/ultidoc_paths_test.go
R3D347HR4Y 0466a1c169
Some checks are pending
CI / Go tests (push) Waiting to run
CI / Integration tests (push) Waiting to run
CI / DB migrations (push) Waiting to run
wow
2026-06-11 01:22:52 +02:00

29 lines
715 B
Go

package nextcloud
import "testing"
func TestSidecarPathForSource(t *testing.T) {
tests := []struct {
source string
sidecar string
}{
{"/docs/report.docx", "/docs/report.ultidoc.json"},
{"docs/report.docx", "/docs/report.ultidoc.json"},
{"/report.docx", "/report.ultidoc.json"},
}
for _, tt := range tests {
if got := SidecarPathForSource(tt.source); got != tt.sidecar {
t.Fatalf("SidecarPathForSource(%q) = %q, want %q", tt.source, got, tt.sidecar)
}
}
}
func TestIsUltidocSidecarPath(t *testing.T) {
if !IsUltidocSidecarPath("/docs/report.ultidoc.json") {
t.Fatal("expected sidecar path")
}
if IsUltidocSidecarPath("/docs/report.docx") {
t.Fatal("docx is not a sidecar path")
}
}