Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for 'matches' function #618

Merged
merged 3 commits into from
Nov 16, 2023

Conversation

opatrascoiu
Copy link
Contributor

No description provided.

@SimonRinguette
Copy link
Contributor

The tests fn-matches-32, fn-matches-33, fn-matches-34 leverage XQuery 3.0 and the DMN spec says that we should use only XQuery 1.0:

pattern, replacement, and flags SHALL conform to the syntax and constraints specified in clause 7.6 of XQuery 1.0 and XPath 2.0 Functions and Operators. Note that where XPath specifies an error result, FEEL specifies a null result. 

Your fn-matchesErr-1 test case check for a 'p' flag that is invalid, in theory the q flag should also be invalid.

Personally, I don't mind opening a RTF issue to allow support for XQuery 3.

K2-MatchesFunc-16... this one my compiler does not seem to think its valid and returns null. Since its a pattern with an interpretation that is unknown, should we consider that a valid test?

Finally, the dmn model has a K2-MatchesFunc-15 decision not referred by the test cases. This one does not compile. It has a comma between the two matches statement that seems out of place.

Otherwise, GREAT test file and would merge.

@opatrascoiu
Copy link
Contributor Author

Thanks @SimonRinguette for the comments. I will look into it in the near future.

@opatrascoiu
Copy link
Contributor Author

@SimonRinguette I committed the following changes to address the comments:

  • commented out fn-matches-32, fn-matches-33, fn-matches-34 - will raise a DMN issue to upgrade to XQuery 3.0
  • left fn-matchesErr-1 in as the test case as AFAIK it is valid both for XQuery 1.0 and XQuery 3.0
  • commented out K2-MatchesFunc-1 as it is debatable at this stage
  • added missing decision for K2-MatchesFunc-15

Please review.

@baldimir baldimir merged commit 028f127 into dmn-tck:master Nov 16, 2023
3 of 5 checks passed
@opatrascoiu opatrascoiu deleted the 1111-feel-matches branch November 16, 2023 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants