(t *testing.T)
| 21 | } |
| 22 | |
| 23 | func TestDataProvider_Cache(t *testing.T) { |
| 24 | dir := createTestTaskDir(t) |
| 25 | dp := NewDataProvider(dir, false) |
| 26 | |
| 27 | // First call should scan |
| 28 | tasks1, err := dp.GetTasks() |
| 29 | if err != nil { |
| 30 | t.Fatalf("unexpected error: %v", err) |
| 31 | } |
| 32 | |
| 33 | // Second call should return cached result |
| 34 | tasks2, err := dp.GetTasks() |
| 35 | if err != nil { |
| 36 | t.Fatalf("unexpected error: %v", err) |
| 37 | } |
| 38 | |
| 39 | if len(tasks1) != len(tasks2) { |
| 40 | t.Fatalf("cache returned different result") |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | func TestDataProvider_Invalidate(t *testing.T) { |
| 45 | dir := createTestTaskDir(t) |
nothing calls this directly
no test coverage detected