MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / kernel_cat_append_builtin

Function kernel_cat_append_builtin

tests/integration/kernel_integration.rs:2376–2406  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2374}
2375
2376// The shell binds the producer's stdout to a temp file the filter reads back, so
2377// the payload only reaches the console if it travelled through the pipe.
2378#[test]
2379fn kernel_pipe_two_stage() {
2380 let shell = compile_hosted_program("shell");
2381 let producer = compile_hosted(
2382 r#"
2383external console_writeln: (str: u8*)
2384external sys_exit: (code: i64)
2385main: () -> i32 {
2386 console_writeln("PIPE_PAYLOAD".ptr)
2387 sys_exit(0)
2388 return 0
2389}
2390"#,
2391 );
2392 // Copy stdin to stdout until EOF (-1): a transparent filter.
2393 let filter = compile_hosted(
2394 r#"
2395external sys_readchar: () -> i64
2396external console_putchar: (c: i32)
2397external sys_exit: (code: i64)
2398main: () -> i32 {
2399 while 1 == 1 {
2400 c: i64 = sys_readchar()
2401 if c < 0 {
2402 break
2403 }
2404 console_putchar(c as i32)
2405 }
2406 sys_exit(0)
2407 return 0
2408}
2409"#,

Callers

nothing calls this directly

Calls 4

compile_hosted_programFunction · 0.85
build_fs_imageFunction · 0.85
boot_kernelFunction · 0.85
cached_kernelFunction · 0.85

Tested by

no test coverage detected