(t *testing.T)
| 20 | ) |
| 21 | |
| 22 | func TestParseUUID_Valid(t *testing.T) { |
| 23 | t.Parallel() |
| 24 | |
| 25 | rw := httptest.NewRecorder() |
| 26 | r := httptest.NewRequest("GET", "/{workspaceagent}", nil) |
| 27 | |
| 28 | ctx := chi.NewRouteContext() |
| 29 | ctx.URLParams.Add(testParam, testWorkspaceAgentID) |
| 30 | r = r.WithContext(context.WithValue(r.Context(), chi.RouteCtxKey, ctx)) |
| 31 | |
| 32 | parsed, ok := ParseUUIDParam(rw, r, "workspaceagent") |
| 33 | assert.True(t, ok, "UUID should be parsed") |
| 34 | assert.Equal(t, testWorkspaceAgentID, parsed.String()) |
| 35 | } |
| 36 | |
| 37 | func TestParseUUID_Invalid(t *testing.T) { |
| 38 | t.Parallel() |
nothing calls this directly
no test coverage detected