(component: &str, extra_flags: &[&str])
| 2504 | } |
| 2505 | |
| 2506 | fn run_much_stdout(component: &str, extra_flags: &[&str]) -> Result<()> { |
| 2507 | let total_write_size = 1 << 18; |
| 2508 | let expected = iter::repeat('a').take(total_write_size).collect::<String>(); |
| 2509 | |
| 2510 | for i in 10..15 { |
| 2511 | let string = iter::repeat('a').take(1 << i).collect::<String>(); |
| 2512 | let times = (total_write_size >> i).to_string(); |
| 2513 | println!("writing {} bytes {times} times", string.len()); |
| 2514 | |
| 2515 | let mut args = Vec::new(); |
| 2516 | args.push("run"); |
| 2517 | args.extend_from_slice(extra_flags); |
| 2518 | args.push(component); |
| 2519 | args.push(&string); |
| 2520 | args.push(×); |
| 2521 | let output = run_wasmtime(&args)?; |
| 2522 | println!( |
| 2523 | "expected {} bytes, got {} bytes", |
| 2524 | expected.len(), |
| 2525 | output.len() |
| 2526 | ); |
| 2527 | assert!(output == expected); |
| 2528 | } |
| 2529 | |
| 2530 | Ok(()) |
| 2531 | } |
| 2532 | |
| 2533 | #[test] |
| 2534 | fn p1_cli_much_stdout() -> Result<()> { |
no test coverage detected