We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 38ba420 commit 4ba7683Copy full SHA for 4ba7683
tests/formatter.rs
@@ -905,3 +905,25 @@ error: unused optional dependency
905
let renderer = Renderer::plain();
906
assert_data_eq!(renderer.render(input).to_string(), expected);
907
}
908
+
909
+// for issue 57
910
+#[test]
911
+fn test_line_number_0() {
912
+ let input = Level::Error.title("dummy").snippet(
913
+ Snippet::source("foo")
914
+ .origin("file/path")
915
+ .line_start(0)
916
+ .annotation(Level::Error.span(2..3)), // bar\nbaz
917
+ );
918
919
+ let expected = str![[r#"
920
+error: dummy
921
+ --> file/path:0:3
922
+ |
923
+0 | foo
924
+ | ^
925
926
+"#]];
927
+ let renderer = Renderer::plain();
928
+ assert_data_eq!(renderer.render(input).to_string(), expected);
929
+}
0 commit comments