use bashkit::Bash;
#[tokio::test]
async fn awk_newline_separates_assignments() {
let mut bash = Bash::new();
let result = bash
.exec(
r#"echo test | awk '{
x=1
y=2
print x, y
}'"#,
)
.await
.unwrap();
assert_eq!(result.stdout.trim(), "1 2");
}
#[tokio::test]
async fn awk_semicolons_still_work() {
let mut bash = Bash::new();
let result = bash
.exec(r#"echo test | awk '{ x=1; y=2; print x, y }'"#)
.await
.unwrap();
assert_eq!(result.stdout.trim(), "1 2");
}
#[tokio::test]
async fn awk_newline_after_if() {
let mut bash = Bash::new();
let result = bash
.exec(
r#"echo test | awk '{
if (1) x=1
y=2
print x, y
}'"#,
)
.await
.unwrap();
assert_eq!(result.stdout.trim(), "1 2");
}