Skip to content

Commit

Permalink
Add tests for 'matches' function. Address comments in PR
Browse files Browse the repository at this point in the history
  • Loading branch information
opatrascoiu committed Nov 2, 2023
1 parent 60f63ae commit 5209cd4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
</resultNode>
</testCase>

<!--
<testCase id="fn-matches-32">
<description>Evaluation of matches function with "q" flag (allowed in XQuery 3.0)</description>
<resultNode name="fn-matches-32">
Expand All @@ -104,6 +105,7 @@
</expected>
</resultNode>
</testCase>
-->

<testCase id="fn-matches-45">
<description>"." does NOT match CR in default mode</description>
Expand Down Expand Up @@ -387,15 +389,33 @@
</resultNode>
</testCase>

<testCase id="K2-MatchesFunc-16">
<description>Use a pattern whose interpretation is unknown. See public report 4466 and 21425.</description>
<resultNode name="K2-MatchesFunc-16">
<testCase id="K2-MatchesFunc-15">
<description> A negative character class never match a non-character. </description>
<resultNode name="K2-MatchesFunc-15" >
<expected>
<value xsi:type="xsd:boolean">false</value>
<list>
<item>
<value xsi:type="xsd:boolean">false</value>
</item>
<item>
<value xsi:type="xsd:boolean">true</value>
</item>
</list>
</expected>
</resultNode>
</testCase>

<!--
<testCase id="K2-MatchesFunc-16">
<description>Use a pattern whose interpretation is unknown. See public report 4466 and 21425.</description>
<resultNode name="K2-MatchesFunc-16">
<expected>
<value xsi:type="xsd:boolean">false</value>
</expected>
</resultNode>
</testCase>
-->

<testCase id="K2-MatchesFunc-17">
<description>Caseless match with back-reference.</description>
<resultNode name="K2-MatchesFunc-17">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Extracted from https://dev.w3.org/2011/QT3-test-suite/ -->
<definitions namespace="http://www.actico.com/spec/DMN/1111-feel-matches-function" name="1111-feel-matches-function"
<definitions namespace="http://www.gs.com/spec/DMN/1111-feel-matches-function" name="1111-feel-matches-function"
id="_1111_feel_matches_function" xmlns="https://www.omg.org/spec/DMN/20211108/MODEL/"
xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/"
xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/"
xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<description>FEEL built-in function 'matches(input, pattern, flags?)' in category string functions</description>

<itemDefinition name="booleanList" isCollection="true">
<typeRef>boolean</typeRef>
</itemDefinition>

<decision name="fn-null-input">
<description>Evaluates "matches" function with null input</description>
<variable typeRef="boolean" name="fn-null-input"/>
Expand Down Expand Up @@ -63,6 +67,7 @@
</literalExpression>
</decision>

<!--
<decision name="fn-matches-32">
<description> Evaluation of matches function with "q" flag (allowed in XQuery 3.0) </description>
<variable typeRef="boolean" name="fn-matches-32"/>
Expand All @@ -86,6 +91,7 @@
<text>matches("x[Y-z]", "X[y-Z]", "qi")</text>
</literalExpression>
</decision>
-->

<decision name="fn-matches-45">
<description> "." does NOT match CR in default mode</description>
Expand Down Expand Up @@ -337,9 +343,9 @@

<decision name="K2-MatchesFunc-15">
<description> A negative character class never match a non-character. </description>
<variable typeRef="boolean" name="K2-MatchesFunc-15"/>
<variable typeRef="booleanList" name="K2-MatchesFunc-15"/>
<literalExpression>
<text>matches("a", "a[^b]"), matches("a ", "a[^b]")</text>
<text>[matches("a", "a[^b]"), matches("a ", "a[^b]")]</text>
</literalExpression>
</decision>

Expand Down

0 comments on commit 5209cd4

Please sign in to comment.