Skip to content

Commit b34aac3

Browse files
committed
test: verify local spec mtime cache precision
1 parent 6d5ed07 commit b34aac3

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

internal/spec/cache_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,17 @@ func TestStoreSpecInCachePreservesLocalSpecFileNanosecondModTime(t *testing.T) {
474474
t.Fatalf("StoreSpecInCache: %v", err)
475475
}
476476

477+
entry, ok := readCacheEntry(dir, "testapi", "v2", true)
478+
if !ok {
479+
t.Fatal("expected cache entry")
480+
}
481+
if len(entry.SpecFiles) != 1 {
482+
t.Fatalf("SpecFiles len = %d, want 1", len(entry.SpecFiles))
483+
}
484+
if got, want := entry.SpecFiles[0].ModTimeUnixNano, info.ModTime().UnixNano(); got != want {
485+
t.Fatalf("cached ModTimeUnixNano = %d, want %d", got, want)
486+
}
487+
477488
got, _, ok := LoadOperationSetFromCacheStatus(dir, "testapi", "v2", []string{specPath}, OperationOptions{}, true)
478489
if !ok {
479490
t.Fatal("expected operations cache hit")

0 commit comments

Comments
 (0)