8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 43a10aa commit 90fa23dCopy full SHA for 90fa23d
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