Files
seaweedfs/weed
Chris Lu 65fcf2d740 test(s3/lifecycle): direct router + engine helper coverage
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.
2026-05-09 20:51:52 -07:00
..
2026-04-10 17:31:14 -07:00
2026-04-10 17:31:14 -07:00
2026-04-14 20:48:24 -07:00
2026-05-06 19:14:36 -07:00
2026-04-23 10:05:51 -07:00