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

Function get_indent_works

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

Source from the content-addressed store, hash-verified

481
482 #[test]
483 fn get_indent_works() {
484 let mut fmt = Formatter::new(Language::Rust);
485 let expected_results = vec!["", " ", " ", ""];
486
487 let actual_results = Vec::with_capacity(4);
488 (0..3).for_each(|_| {
489 fmt.get_indent();
490 fmt.indent_push();
491 });
492 (0..3).for_each(|_| fmt.indent_pop());
493 fmt.get_indent();
494
495 actual_results
496 .into_iter()
497 .zip(expected_results)
498 .for_each(|(actual, expected): (String, &str)| assert_eq!(&actual, expected));
499 }
500
501 #[test]
502 fn fmt_can_add_type_to_lines() {

Callers

nothing calls this directly

Calls 5

get_indentMethod · 0.80
indent_pushMethod · 0.80
indent_popMethod · 0.80
newFunction · 0.50
into_iterMethod · 0.45

Tested by

no test coverage detected