MCPcopy Create free account
hub / github.com/SeaQL/FireDBG.for.Rust / main

Function main

debugger/tests/return_enum.rs:10–108  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8
9#[tokio::test]
10async fn main() -> Result<()> {
11 let testcase = "return_enum";
12
13 let debugger_params = debugger_params_from_file(testcase);
14
15 let (producer, consumer) = setup(testcase).await?;
16
17 Debugger::run(debugger_params, producer.clone());
18
19 producer.end().await?;
20
21 for i in 0..14 {
22 let payload = consumer.next().await?.message().into_bytes();
23 let event = EventStream::read_from(Bytes::from(payload));
24 // println!("#{i} {:?}", event);
25
26 match (i, event) {
27 (
28 _,
29 Event::FunctionCall {
30 function_name,
31 arguments,
32 ..
33 },
34 ) => {
35 assert_eq!(
36 arguments.len(),
37 match i {
38 0 => 0,
39 _ => 1,
40 }
41 );
42 assert_eq!(
43 function_name,
44 match i {
45 0 => "return_enum::main",
46 1 => "return_enum::shrink",
47 3 => "return_enum::flip",
48 5 => "return_enum::flip",
49 7 => "return_enum::advance",
50 9 => "return_enum::advance",
51 11 => "return_enum::advance",
52 _ => panic!("Unexpected i {i}"),
53 }
54 );
55 if i == 0 {
56 println!("[{i}] {function_name}() ..");
57 } else {
58 let (name, value) = &arguments[0];
59 println!("[{i}] {function_name}({name} = {value}) ..");
60 }
61 }
62 (
63 _,
64 Event::FunctionReturn {
65 function_name,
66 return_value,
67 ..

Callers

nothing calls this directly

Calls 6

setupFunction · 0.85
into_bytesMethod · 0.80
nextMethod · 0.80
runFunction · 0.50
endMethod · 0.45

Tested by

no test coverage detected