MCPcopy Create free account
hub / github.com/PRQL/prql / test_error_messages

Function test_error_messages

prqlc/prqlc-parser/src/parser/perror.rs:119–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

117
118 #[test]
119 fn test_error_messages() {
120 let error1 = simple_error("test error");
121 assert_snapshot!(error1.to_string(), @r#"Error { kind: Error, span: None, reason: Simple("test error"), hints: [], code: None }"#);
122
123 let error2 = simple_error("another error").with_span(Some(crate::span::Span {
124 start: 0,
125 end: 5,
126 source_id: 0,
127 }));
128 assert_debug_snapshot!(error2, @r#"
129 Error {
130 kind: Error,
131 span: Some(
132 0:0-5,
133 ),
134 reason: Simple(
135 "another error",
136 ),
137 hints: [],
138 code: None,
139 }
140 "#);
141 }
142}

Callers

nothing calls this directly

Calls 2

simple_errorFunction · 0.85
with_spanMethod · 0.80

Tested by

no test coverage detected