()
| 12 | |
| 13 | #[tokio::test] |
| 14 | async fn main() -> Result<()> { |
| 15 | let testcase = "pointer"; |
| 16 | let (producer, consumer) = setup(testcase).await?; |
| 17 | |
| 18 | rustc(&format!("testcases/{testcase}")); |
| 19 | |
| 20 | Debugger::run( |
| 21 | DebuggerParams { |
| 22 | binary: format!("testcases/{testcase}.o"), |
| 23 | files: vec![ |
| 24 | Default::default(), |
| 25 | SourceFile { |
| 26 | id: 1, |
| 27 | path: format!("testcases/{testcase}.rs"), |
| 28 | crate_name: testcase.into(), |
| 29 | modified: SystemTime::UNIX_EPOCH, |
| 30 | }, |
| 31 | ], |
| 32 | breakpoints: vec![ |
| 33 | Default::default(), |
| 34 | Breakpoint { |
| 35 | id: 1, |
| 36 | file_id: 1, |
| 37 | loc: LineColumn { |
| 38 | line: 30, |
| 39 | column: None, |
| 40 | }, |
| 41 | loc_end: None, |
| 42 | breakpoint_type: BreakpointType::Breakpoint, |
| 43 | capture: VariableCapture::Locals, |
| 44 | }, |
| 45 | Breakpoint { |
| 46 | id: 2, |
| 47 | file_id: 1, |
| 48 | loc: LineColumn { |
| 49 | line: 44, |
| 50 | column: None, |
| 51 | }, |
| 52 | loc_end: None, |
| 53 | breakpoint_type: BreakpointType::Breakpoint, |
| 54 | capture: VariableCapture::Locals, |
| 55 | }, |
| 56 | ], |
| 57 | arguments: vec![], |
| 58 | }, |
| 59 | producer.clone(), |
| 60 | ); |
| 61 | |
| 62 | producer.end().await?; |
| 63 | for i in 0..2 { |
| 64 | let payload = consumer.next().await?.message().into_bytes(); |
| 65 | let event = EventStream::read_from(Bytes::from(payload)); |
| 66 | match event { |
| 67 | Event::Breakpoint { mut locals, .. } => match i { |
| 68 | 0 => { |
| 69 | assert!(locals.len() >= 3); |
| 70 | for (j, (name, value)) in locals.iter_mut().enumerate().take(3) { |
| 71 | value.redact_addr(); |
nothing calls this directly
no test coverage detected