(t *testing.T)
| 92 | } |
| 93 | |
| 94 | func TestIsStale(t *testing.T) { |
| 95 | dir := t.TempDir() |
| 96 | path := filepath.Join(dir, "SOUL.md") |
| 97 | _ = os.WriteFile(path, []byte("v1"), 0o644) |
| 98 | |
| 99 | bl := NewBootstrapLoader(dir, "", testLogger()) |
| 100 | bl.LoadFile("SOUL.md") |
| 101 | |
| 102 | if bl.IsStale() { |
| 103 | t.Error("should not be stale immediately after load") |
| 104 | } |
| 105 | |
| 106 | time.Sleep(10 * time.Millisecond) |
| 107 | _ = os.WriteFile(path, []byte("v2"), 0o644) |
| 108 | |
| 109 | if !bl.IsStale() { |
| 110 | t.Error("should be stale after file modification") |
| 111 | } |
| 112 | } |
nothing calls this directly
no test coverage detected