MCPcopy Create free account
hub / github.com/davidblewett/rure-python / roundtrip_with

Function roundtrip_with

regex/regex-syntax/src/ast/print.rs:424–435  ·  view source on GitHub ↗
(mut f: F, given: &str)

Source from the content-addressed store, hash-verified

422 }
423
424 fn roundtrip_with<F>(mut f: F, given: &str)
425 where F: FnMut(&mut ParserBuilder) -> &mut ParserBuilder
426 {
427 let mut builder = ParserBuilder::new();
428 f(&mut builder);
429 let ast = builder.build().parse(given).unwrap();
430
431 let mut printer = Printer::new();
432 let mut dst = String::new();
433 printer.print(&ast, &mut dst).unwrap();
434 assert_eq!(given, dst);
435 }
436
437 #[test]
438 fn print_literal() {

Callers 2

roundtripFunction · 0.70
print_literalFunction · 0.70

Calls 4

unwrapMethod · 0.80
parseMethod · 0.45
buildMethod · 0.45
printMethod · 0.45

Tested by 1

print_literalFunction · 0.56