Skip to content

Commit f4fb79e

Browse files
committed
Add pretty print of verification output
1 parent e98f7e3 commit f4fb79e

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/libcprover-rust/src/lib.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use cxx::{CxxVector, CxxString};
12
#[cxx::bridge]
23
pub mod ffi {
34

@@ -17,6 +18,21 @@ pub mod ffi {
1718
fn translate_vector_of_string(elements: Vec<String>) -> &'static CxxVector<CxxString>;
1819
fn get_messages() -> &'static CxxVector<CxxString>;
1920
}
21+
22+
extern "Rust" {
23+
fn print_response(vec: &CxxVector<CxxString>);
24+
}
25+
}
26+
27+
fn print_response(vec: &CxxVector<CxxString>) {
28+
let vec: Vec<String> = vec
29+
.iter()
30+
.map(|s| s.to_string_lossy().into_owned())
31+
.collect();
32+
33+
for s in vec {
34+
println!("{}", s);
35+
}
2036
}
2137

2238
// To test run "cargo test -- --nocapture"
@@ -76,6 +92,6 @@ mod tests {
7692
client.verify_model();
7793

7894
let msgs = ffi::get_messages();
79-
println!("{:?}", msgs);
95+
print_response(msgs);
8096
}
8197
}

0 commit comments

Comments
 (0)