diff --git a/README.md b/README.md
index f0ce90f..35ccac4 100644
--- a/README.md
+++ b/README.md
@@ -88,7 +88,7 @@ flowchart TB
PureXML is a working, dependency-free XML library today: parse, emit, validate,
query, and stream documents on macOS, Linux, Windows, and WASM. The test suite
-currently runs **766 tests in 117 suites** (`swift test`).
+currently runs **767 tests in 117 suites** (`swift test`).
### Shipped (libxml2-aligned surface)
diff --git a/Tests/XSDIdentityTests.swift b/Tests/XSDIdentityTests.swift
index c9d4352..9a132f5 100644
--- a/Tests/XSDIdentityTests.swift
+++ b/Tests/XSDIdentityTests.swift
@@ -104,4 +104,30 @@ struct XSDIdentityTests {
#expect(failure.codingPath.map(\.stringValue) == ["list", "item"])
#expect(String(describing: failure).hasSuffix("at path: list/item[2]"))
}
+
+ @Test("A nested selector locates the offender at full depth with an intermediate index")
+ func test_identityErrorDeepPath() throws {
+ let xsd = """
+ \(head)
+
+
+
+
+
+
+
+
+
+
+
+
+
+ """
+ // The duplicate id "1" appears in the second group, so the offender is
+ // list/group[2]/item: a grandchild, with the index on the intermediate group.
+ let xml = "
"
+ let failure = try #require(validate(xsd, xml).first)
+ #expect(failure.codingPath.map(\.stringValue) == ["list", "group", "item"])
+ #expect(String(describing: failure).hasSuffix("at path: list/group[2]/item"))
+ }
}