package api import "testing" func TestUIPathSegRoundTrip(t *testing.T) { cases := []string{ "", "Vendor Name", "Model_With_Underscore", "Name With Both_Value", } for _, tc := range cases { encoded := uiPathSeg(tc) decoded := uiUnpathSeg(encoded) if decoded != tc { t.Fatalf("round trip %q => %q => %q", tc, encoded, decoded) } } }