rpki/tests/test_rtr_admin.rs
2026-06-23 17:04:00 +08:00

14 lines
377 B
Rust

use rpki::rtr::admin::tail_log_lines;
#[test]
fn tail_log_lines_returns_requested_suffix() {
let output = tail_log_lines(b"one\ntwo\nthree\nfour\n".to_vec(), 2);
assert_eq!(output, b"three\nfour\n");
}
#[test]
fn tail_log_lines_returns_whole_buffer_when_shorter() {
let output = tail_log_lines(b"one\ntwo\n".to_vec(), 5);
assert_eq!(output, b"one\ntwo\n");
}