Add Int64 file rotation path and JSON roundtrip

This commit is contained in:
Nanaloveyuki
2026-07-05 21:31:52 +08:00
parent 93e9bd966d
commit e001315319
13 changed files with 368 additions and 23 deletions
+22
View File
@@ -160,6 +160,28 @@ test "queue helper preserves file rotation when applied after rotation" {
}
}
///|
test "file rotation i64 helper preserves file preset shape" {
let config = with_file_rotation_i64(
with_queue(file("service.log", append=false), max_pending=8),
4294967296L,
max_backups=2,
)
inspect(config.sink.path, content="service.log")
inspect(config.sink.append, content="false")
match config.sink.rotation {
Some(rotation) => {
inspect(rotation.max_bytes, content="2147483647")
inspect(rotation.max_backups, content="2")
match rotation.native_wide_max_bytes {
Some(value) => inspect(value, content="4294967296")
None => inspect(false, content="true")
}
}
None => inspect(false, content="true")
}
}
///|
test "file rotation helper leaves non-file presets unchanged" {
let console_config = with_file_rotation(