mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-05-23 02:01:32 +00:00
Bundles direct tests for several pure helpers in router.go and accessors on engine.Snapshot — all previously exercised only indirectly through the larger Route* / Compile tests, where a helper-level regression would surface as a downstream failure that's harder to diagnose. Router helpers: - successorModTimeFromContainer: missing ext, empty value, non-numeric garbage, non-positive seconds, positive seconds round-trip - logicalKeyFromVersionPath: extracts logical key, rejects path with non-.versions parent, root-level path with no real parent, no slashes at all, empty after trim - isVersionsContainerKey: bucket-root .versions rejected, trailing .versions accepted, files inside the container rejected - isVersionFolderPath: child of .versions accepted, container itself rejected, no-slash rejected; documents the trailing-slash edge - isDeleteMarkerEntry: nil/empty extended false, only literal "true" matches (case-insensitive variants and "1" rejected) - extractTags: nil/empty input returns nil, only AmzObjectTagging- prefixed keys surface, no-tag input returns nil (not empty map) - hasActiveEventDrivenAction: matches only active+event-driven kinds, scan-only kind rejected, unknown action skipped Engine snapshot accessors: - BucketVersioned reflects the compiled flag, unknown bucket false - BucketActionKeys returns all compiled keys for the bucket, unknown bucket nil - Action returns nil for unknown key - AllActions enumerates every compiled kind regardless of active state - SnapshotID is strictly monotonic across recompiles (the dispatcher's stale-snapshot check depends on this) 24 tests total, all passing under -race.