Skip to content

Commit ba9a008

Browse files
Add regression test for span 1-indexed check
1 parent 59477a8 commit ba9a008

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Diff for: tests/rustdoc-json/impls/auto.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ impl Foo {
1515
}
1616

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

Diff for: tests/rustdoc-json/span.rs

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

0 commit comments

Comments
 (0)