(t *testing.T)
| 78 | t.Fatalf("expected 1 exercise, got %d", len(exercises)) |
| 79 | } |
| 80 | ex0 := exercises[0].(map[string]any) |
| 81 | sets, ok := ex0["sets"].([]any) |
| 82 | if !ok { |
| 83 | t.Fatalf("sets field missing or wrong type: %T = %v", ex0["sets"], ex0["sets"]) |
| 84 | } |
| 85 | if len(sets) != 3 { |
| 86 | t.Errorf("expected 3 sets, got %d", len(sets)) |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | func TestCreateProgram_missingName(t *testing.T) { |
| 91 | setupTestDB(t) |
| 92 | uid := createTestUser(t) |
| 93 | |
| 94 | body := map[string]any{ |
| 95 | "name": "", |
| 96 | "days": []map[string]any{}, |
| 97 | } |
nothing calls this directly
no test coverage detected