Skip to content
This repository has been archived by the owner on Nov 17, 2022. It is now read-only.

Test correct handling of whitespace in Ruleset tests #233

Open
6 tasks
hayfield opened this issue Nov 9, 2017 · 0 comments
Open
6 tasks

Test correct handling of whitespace in Ruleset tests #233

hayfield opened this issue Nov 9, 2017 · 0 comments
Labels
missing-feature A major feature that should exist, but does not. rulesets Relating to IATI Rulesets. tests Relating to tests and testing.

Comments

@hayfield
Copy link
Contributor

hayfield commented Nov 9, 2017

As noted at #229 (comment):

The XPath spec which shows that text() returns the entire text node. The XPath in the mapping file says that the comparison is against this value (rather than a trimmed or stripped version). As such, checking against a modified text node is not correct.
Further, the XML Spec shows that white space is significant and must be treated as part of a value - treating it as not-present is incorrect.

As such, any Rule that undertakes checks on strings should have tests to ensure whitespace is included in the check (rather than being stripped, ignored, or such).

This covers the following standard Rules:

  • sum (whitespace currently tested in valid_sum.xml)
  • date_order - (no whitespace tests at present - attributes in the Standard Ruleset are covered by Schema checks for a correct date type (no whitespace), though other attributes or element text are not)
  • regex_matches - (can see no tests at present, though understand whitespace may currently be ignored due to an interpretation of perl style regular expression)
  • regex_no_matches - (can see no tests at present, though understand whitespace may currently be ignored due to an interpretation of perl style regular expression)
  • startswith - (no whitespace tests at present)
  • unique - (no whitespace tests at present)
@hayfield hayfield added bug This issue identifies and details a bug. rulesets Relating to IATI Rulesets. tests Relating to tests and testing. missing-feature A major feature that should exist, but does not. and removed bug This issue identifies and details a bug. labels Nov 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
missing-feature A major feature that should exist, but does not. rulesets Relating to IATI Rulesets. tests Relating to tests and testing.
Projects
None yet
Development

No branches or pull requests

1 participant