Skip to content

Commit 3a46662

Browse files
committed
test: Add a test for max_line_num with no fold
1 parent d124bf6 commit 3a46662

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

tests/formatter.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2574,3 +2574,41 @@ LL + break;
25742574
let renderer_unicode = renderer_ascii.theme(OutputTheme::Unicode);
25752575
assert_data_eq!(renderer_unicode.render(input), expected_unicode);
25762576
}
2577+
2578+
#[test]
2579+
fn max_line_num_no_fold() {
2580+
let source = r#"cargo
2581+
fuzzy
2582+
pizza
2583+
jumps
2584+
crazy
2585+
quack
2586+
zappy
2587+
"#;
2588+
2589+
let input_new = &[Group::with_title(
2590+
Level::ERROR
2591+
.title("the size for values of type `T` cannot be known at compilation time")
2592+
.id("E0277"),
2593+
)
2594+
.element(
2595+
Snippet::source(source)
2596+
.line_start(8)
2597+
.fold(false)
2598+
.annotation(AnnotationKind::Primary.span(6..11)),
2599+
)];
2600+
let expected = str![[r#"
2601+
error[E0277]: the size for values of type `T` cannot be known at compilation time
2602+
|
2603+
8 | cargo
2604+
9 | fuzzy
2605+
| ^^^^^
2606+
10| pizza
2607+
11| jumps
2608+
12| crazy
2609+
13| quack
2610+
14| zappy
2611+
"#]];
2612+
let renderer = Renderer::plain();
2613+
assert_data_eq!(renderer.render(input_new), expected);
2614+
}

0 commit comments

Comments
 (0)