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 287979f commit 606ea5eCopy full SHA for 606ea5e
tests/test.rs
@@ -264,6 +264,26 @@ fn literal_parse() {
264
assert!("-\"\"".parse::<Literal>().is_err());
265
}
266
267
+#[test]
268
+fn literal_span() {
269
+ let positive = "0.1".parse::<Literal>().unwrap();
270
+ let negative = "-0.1".parse::<Literal>().unwrap();
271
+
272
+ #[cfg(not(span_locations))]
273
+ {
274
+ let _ = positive;
275
+ let _ = negative;
276
+ }
277
278
+ #[cfg(span_locations)]
279
280
+ assert_eq!(positive.span().start().column, 0);
281
+ assert_eq!(positive.span().end().column, 3);
282
+ assert_eq!(negative.span().start().column, 0);
283
+ assert_eq!(negative.span().end().column, 4);
284
285
+}
286
287
#[test]
288
fn roundtrip() {
289
fn roundtrip(p: &str) {
0 commit comments