use std::path::Path;
use bashkit::{Bash, ExecutionLimits};
#[tokio::test]
async fn newline_dense_line_selection_is_correct_at_scale() {
let mut bash = Bash::builder()
.limits(ExecutionLimits::new().max_live_intermediate_bytes(1_024))
.build();
bash.fs()
.write_file(Path::new("/dense"), &vec![b'\n'; 1_000_000])
.await
.unwrap();
let head = bash.exec("head -n 1 /dense").await.unwrap();
assert_eq!(head.exit_code, 0);
assert_eq!(head.stdout.as_bytes(), b"\n");
let tail = bash.exec("tail -n 1 /dense").await.unwrap();
assert_eq!(tail.exit_code, 0);
assert_eq!(tail.stdout.as_bytes(), b"\n");
}