getodk / web-forms

ODK Web Forms enables form filling and submission editing of ODK forms in a web browser. It's coming soon! ✨

Home Page:https://getodk.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Verify that `xpath` produces `-0` consistent with spec

eyelidlessness opened this issue · comments

In #111, a few assertion swaps surfaced the fact that certain XPath expressions evaluate to -0, and that the Chai-style assertions did not distinguish that from 0. As noted in review there, each of those cases were either:

  • Inferred correct by extrapolating from the underlying W3C XPath spec to the ODK extension thereof
  • Inferred correct, where the spec isn't detailed, by comparing with native behavior

We should do a more thorough pass through the existing test cases to:

  1. Validate and/or fix any other expressions that would be expected to produce -0, with the same reasoning
  2. Ensure there is coverage for any other clear cases identified in the spec

This is probably not the most important bit of minutiae in the world, and isn't a particularly high priority (unless it becomes important to users for some specific use case where -0 is important to distinguish in a real form). I'm filing this mostly in the spirit of adherence to spec. But part of the motivation is also that thoroughness of this kind can sometimes surface other related issues that might be more important.