MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / formatter_basic_example_works

Function formatter_basic_example_works

cranelift/srcgen/src/lib.rs:467–480  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

465
466 #[test]
467 fn formatter_basic_example_works() {
468 let mut fmt = Formatter::new(Language::Rust);
469 fmt.line("Hello line 1");
470 fmt.indent_push();
471 fmt.comment("Nested comment");
472 fmt.indent_pop();
473 fmt.line("Back home again");
474 let expected_lines = vec![
475 "Hello line 1\n",
476 " // Nested comment\n",
477 "Back home again\n",
478 ];
479 assert_eq!(fmt.lines, expected_lines);
480 }
481
482 #[test]
483 fn get_indent_works() {

Callers

nothing calls this directly

Calls 5

indent_pushMethod · 0.80
commentMethod · 0.80
indent_popMethod · 0.80
newFunction · 0.50
lineMethod · 0.45

Tested by

no test coverage detected