Add regression test for span 1-indexed check

This commit is contained in:
Guillaume Gomez 2025-04-16 15:28:28 +02:00
parent 59477a8ab2
commit ba9a008d90
2 changed files with 6 additions and 2 deletions

View file

@ -15,8 +15,8 @@ impl Foo {
}
// Testing spans, so all tests below code
//@ is "$.index[?(@.docs=='has span')].span.begin" "[13, 0]"
//@ is "$.index[?(@.docs=='has span')].span.end" "[15, 1]"
//@ is "$.index[?(@.docs=='has span')].span.begin" "[13, 1]"
//@ is "$.index[?(@.docs=='has span')].span.end" "[15, 2]"
// FIXME: this doesn't work due to https://github.com/freestrings/jsonpath/issues/91
// is "$.index[?(@.inner.impl.is_synthetic==true)].span" null
pub struct Foo;

View file

@ -0,0 +1,4 @@
pub mod bar {}
// This test ensures that spans are 1-indexed.
//@ is "$.index[?(@.name=='span')].span.begin" "[1, 1]"
//@ is "$.index[?(@.name=='bar')].span.begin" "[1, 1]"