mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-07-29 22:16:34 +00:00
✅ clean native rotation test artifacts
This commit is contained in:
@@ -562,12 +562,17 @@ test "file sink set policy applies bundled runtime policy" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test "file sink tracks rotation failures on unavailable backend" {
|
test "file sink tracks rotation failures on unavailable backend" {
|
||||||
let sink = file_sink("bitlogger-rotate.log", rotation=Some(file_rotation(1, max_backups=1)))
|
let path = "bitlogger-rotate.log"
|
||||||
|
ignore(remove_file_internal(path))
|
||||||
|
ignore(remove_file_internal(path + ".1"))
|
||||||
|
let sink = file_sink(path, rotation=Some(file_rotation(1, max_backups=1)))
|
||||||
sink.write(record(Level::Info, "a"))
|
sink.write(record(Level::Info, "a"))
|
||||||
if sink.is_available() {
|
if sink.is_available() {
|
||||||
inspect(sink.rotation_failures(), content="0")
|
inspect(sink.rotation_failures(), content="0")
|
||||||
inspect(sink.write_failures(), content="0")
|
inspect(sink.write_failures(), content="0")
|
||||||
ignore(sink.close())
|
ignore(sink.close())
|
||||||
|
ignore(remove_file_internal(path))
|
||||||
|
ignore(remove_file_internal(path + ".1"))
|
||||||
} else {
|
} else {
|
||||||
inspect(sink.rotation_failures(), content="0")
|
inspect(sink.rotation_failures(), content="0")
|
||||||
inspect(sink.write_failures(), content="1")
|
inspect(sink.write_failures(), content="1")
|
||||||
|
|||||||
Reference in New Issue
Block a user