MCPcopy Create free account
hub / github.com/chanced/jsonptr / parse_error_offsets

Function parse_error_offsets

src/pointer.rs:1570–1582  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1568
1569 #[test]
1570 fn parse_error_offsets() {
1571 let err = Pointer::parse("/foo/invalid~encoding").unwrap_err();
1572 assert_eq!(err.pointer_offset(), 4);
1573 assert_eq!(err.source_offset(), 8);
1574 assert_eq!(err.complete_offset(), 12);
1575
1576 let err = Pointer::parse("invalid~encoding").unwrap_err();
1577 assert_eq!(err.pointer_offset(), 0);
1578 assert_eq!(err.source_offset(), 0);
1579
1580 let err = Pointer::parse("no-leading/slash").unwrap_err();
1581 assert!(err.source().is_none());
1582 }
1583
1584 #[test]
1585 fn pointer_buf_clear() {

Callers

nothing calls this directly

Calls 1

parseFunction · 0.85

Tested by

no test coverage detected