diff --git a/TestCases/compliance-level-3/1111-feel-matches-function/1111-feel-matches-function-test-01.xml b/TestCases/compliance-level-3/1111-feel-matches-function/1111-feel-matches-function-test-01.xml new file mode 100644 index 000000000..b6775fff0 --- /dev/null +++ b/TestCases/compliance-level-3/1111-feel-matches-function/1111-feel-matches-function-test-01.xml @@ -0,0 +1,427 @@ + + + + 1111-feel-matches-function.dmn + + + + + + + + + Evaluates "matches" function with null input + + + + + + + + + Evaluates "matches" function with null pattern + + + + + + + + + Evaluates "matches" function with null flags + + + true + + + + + + Evaluates The "matches" function with the arguments set as follows: $input = xs:string(lower bound) + $pattern = xs:string(lower bound) + + + + true + + + + + + Invalid flag for third argument of matches. + + + + + + + + + Check for the correct behavior of ^ and $ in multi-line mode This test case was motivated by the + resolution of Bug Report 4543 + + + + true + + + + + + Check for the correct behavior of ^ and $ in multi-line mode This test case was motivated by the + resolution of Bug Report 4543 + + + + true + + + + + + + + "." does NOT match CR in default mode + + + false + + + + + + Simple call of matches() with "i" flag + + + true + + + + + + Call of matches() with "i" flag and a character range + + + true + + + + + + Call of matches() with "i" flag and a character range + + + true + + + + + + Call of matches() with "i" flag and Kelvin sign Kelvin sign + + + true + + + + + + Call of matches() with "i" flag and range subtraction + + + true + + + + + + Call of matches() with "i" flag and range subtraction + + + true + + + + + + Call of matches() with "i" flag and range subtraction + + + false + + + + + + Call of matches() with "i" flag and range subtraction + + + false + + + + + + Call of matches() with "i" flag and negation + + + false + + + + + + Call of matches() with "i" flag and negation + + + false + + + + + + The pattern can't be the empty sequence. + + + + + + + + + matches() takes at least two arguments, not one. + + + + + + + + + The third argument cannot be the empty sequence. + + + + + + + + + Only three arguments are accepted. + + + + + + + + + The flags argument cannot contain whitespace. + + + + + + + + + The flags argument cannot contain 'X'. + + + + + + + + + Whitespace in the regexp is collapsed. + + + true + + + + + + Whitespace(before) in the regexp is collapsed, but not inside a character class. + + + true + + + + + + Whitespace(after) in the regexp is collapsed, but not inside a character class. + + + true + + + + + + Whitespace(in the middle) in the regexp is collapsed, but not inside a character class. + + + + true + + + + + + whitespace in the regexp is collapsed, and should therefore compile. + + + true + + + + + + whitespace in the regexp is collapsed completely, and should therefore compile and match. + + + + true + + + + + + whitespace in the regexp is not collapsed, and should therefore not compile. + + + + + + + + + Since no string is captured by the back-reference, the single character is matched. + + + + + + + + + Since no string is captured by the back-reference, the single character is matched(#2). + + + + + + + + + + A non-matching backwards-reference matches the empty string. + + + + + + + + + Use a back reference inside a character class. + + + + + + + + + Use a back reference inside a character class(#2). + + + + + + + + + Use a back reference inside a character class(#3). + + + + + + + + + Use a back reference inside a character class(#3). + + + + + + + + + A negative character class never match a non-character. + + + + + false + + + true + + + + + + + + + + Caseless match with back-reference. + + + true + + + + diff --git a/TestCases/compliance-level-3/1111-feel-matches-function/1111-feel-matches-function.dmn b/TestCases/compliance-level-3/1111-feel-matches-function/1111-feel-matches-function.dmn new file mode 100644 index 000000000..21e55264c --- /dev/null +++ b/TestCases/compliance-level-3/1111-feel-matches-function/1111-feel-matches-function.dmn @@ -0,0 +1,369 @@ + + + + FEEL built-in function 'matches(input, pattern, flags?)' in category string functions + + + boolean + + + + Evaluates "matches" function with null input + + + matches(null, "pattern") + + + + + Evaluates "matches" function with null pattern + + + matches("input", null) + + + + + Evaluates "matches" function with null flags + + + matches("abracadabra", "bra", null) + + + + + Evaluates "matches" function with the arguments set as follows: $input = xs:string(lower bound) $pattern = xs:string(lower bound) + + + matches("This is a characte","This is a characte") + + + + + Invalid flag for third argument of matches. + + + matches("abracadabra", "bra", "p") + + + + + Check for the correct behavior of ^ and $ in multi-line mode This test case was motivated by the resolution of Bug Report 4543 + + + matches("\nabcd\ndefg\n", "^$", "m") + + + + + Check for the correct behavior of ^ and $ in multi-line mode This test case was motivated by the resolution of Bug Report 4543 + + + matches("abcd\n\ndefg\n ", "^$", "m") + + + + + + + "." does NOT match CR in default mode + + + matches("Mary\u000DJones", "Mary.Jones") + + + + + Simple call of matches() with "i" flag + + + matches("abc", "ABC", "i") + + + + + Call of matches() with "i" flag and a character range + + + matches("abZ", "[A-Z]*", "i") + + + + + Call of matches() with "i" flag and a character range + + + matches("abZ", "[a-z]*", "i") + + + + + Call of matches() with "i" flag and Kelvin sign Kelvin sign + + + matches("\u212A", "k", "i") + + + + + Call of matches() with "i" flag and range subtraction + + + matches("x", "[A-Z-[OI]]", "i") + + + + + Call of matches() with "i" flag and range subtraction + + + matches("X", "[A-Z-[OI]]", "i") + + + + + Call of matches() with "i" flag and range subtraction + + + matches("O", "[A-Z-[OI]]", "i") + + + + + Call of matches() with "i" flag and range subtraction + + + matches("i", "[A-Z-[OI]]", "i") + + + + + Call of matches() with "i" flag and negation + + + matches("Q", "[^Q]", "i") + + + + + Call of matches() with "i" flag and negation + + + matches("q", "[^Q]", "i") + + + + + The pattern can't be the empty sequence. + + + matches("input", []) + + + + + matches() takes at least two arguments, not one. + + + matches("input") + + + + + The third argument cannot be the empty sequence. + + + matches("input", "pattern", []) + + + + + Only three arguments are accepted. + + + matches("input", "pattern", "", []) + + + + + The flags argument cannot contain whitespace. + + + matches("input", "pattern", " ") + + + + + The flags argument cannot contain 'X'. + + + matches("input", "pattern", "X") + + + + + Whitespace in the regexp is collapsed. + + + matches("hello world", "hello\ sworld", "x") + + + + + Whitespace(before) in the regexp is collapsed, but not inside a character class. + + + matches("hello world", " hello[ ]world", "x") + + + + + Whitespace(after) in the regexp is collapsed, but not inside a character class. + + + matches("hello world", "hello[ ]world ", "x") + + + + + Whitespace(in the middle) in the regexp is collapsed, but not inside a character class. + + + matches("hello world", "he ll o[ ]worl d", "x") + + + + + whitespace in the regexp is collapsed, and should therefore compile. + + + matches("hello world", "\p{ IsBasicLatin}+", "x") + + + + + whitespace in the regexp is collapsed completely, and should therefore compile and match. + + + matches("hello world", "\p{ I s B a s i c L a t i n }+", "x") + + + + + whitespace in the regexp is not collapsed, and should therefore not compile. + + + matches("hello world", "\p{ IsBasicLatin}+") + + + + + Since no string is captured by the back-reference, the single character is matched. + + + matches("h", "(.)\3") + + + + + Since no string is captured by the back-reference, the single character is matched(#2). + + + matches("h", "(.)\2") + + + + + A non-matching backwards-reference matches the empty string. + + + matches("input", "\3") + + + + + Use a back reference inside a character class. + + + matches("abcd", "(asd)[\1]") + + + + + Use a back reference inside a character class(#2). + + + matches("abcd", "(asd)[asd\1]") + + + + + Use a back reference inside a character class(#3). + + + matches("abcd", "(asd)[asd\0]") + + + + + Use a back reference inside a character class(#3). + + + matches("abcd", "1[asd\0]") + + + + + A negative character class never match a non-character. + + + [matches("a", "a[^b]"), matches("a ", "a[^b]")] + + + + + Use a pattern whose interpretation is unknown. See public report 4466 and 21425. + + + matches("input", "[0-9-.]*/") + + + + + Caseless match with back-reference. + + + matches("aA", "(a)\1", "i") + + + + +