(t *testing.T)
| 29 | } |
| 30 | |
| 31 | func TestLoadBuiltinScripts_FirstRun(t *testing.T) { |
| 32 | store := newMockStore() |
| 33 | |
| 34 | // Directly sync the local builtinScripts to simulate first run without network |
| 35 | for _, s := range builtinScripts { |
| 36 | sc := s |
| 37 | sc.CreatedAt = sc.UpdatedAt |
| 38 | store.SaveScript(&sc) |
| 39 | } |
| 40 | |
| 41 | if len(store.scripts) != len(builtinScripts) { |
| 42 | t.Errorf("loaded %d scripts, want %d", len(store.scripts), len(builtinScripts)) |
| 43 | } |
| 44 | |
| 45 | for _, bs := range builtinScripts { |
| 46 | if _, ok := store.scripts[bs.ID]; !ok { |
| 47 | t.Errorf("builtin script %q not loaded", bs.ID) |
| 48 | } |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | func TestLoadBuiltinScripts_UpdatesExisting(t *testing.T) { |
| 53 | store := newMockStore() |
nothing calls this directly
no test coverage detected