|
21 | 21 | :)
|
22 | 22 | xquery version "3.1";
|
23 | 23 |
|
24 |
| -module namespace fnp="http://exist-db.org/xquery/test/function_collation_key"; |
| 24 | +module namespace fnck="http://exist-db.org/xquery/test/function_collation_key"; |
25 | 25 |
|
26 | 26 | declare namespace test="http://exist-db.org/xquery/xqsuite";
|
27 | 27 |
|
28 | 28 | declare
|
29 | 29 | %test:assertTrue
|
30 |
| -function fnp:equal() { |
31 |
| - let $first := fn:collation-key("a", "http://www.w3.org/2013/collation/UCA?strength=primary") |
32 |
| - let $second := fn:collation-key("a", "http://www.w3.org/2013/collation/UCA?strength=primary") |
| 30 | +function fnck:default-equal-case() { |
| 31 | + let $first := fn:collation-key("a") |
| 32 | + let $second := fn:collation-key("a") |
33 | 33 | return $first = $second
|
34 | 34 | };
|
35 | 35 |
|
36 | 36 | declare
|
37 | 37 | %test:assertTrue
|
38 |
| -function fnp:equal-ignore-case() { |
39 |
| - let $first := fn:collation-key("a", "http://www.w3.org/2013/collation/UCA?strength=primary") |
40 |
| - let $second := fn:collation-key("A", "http://www.w3.org/2013/collation/UCA?strength=primary") |
| 38 | +function fnck:default-equal() { |
| 39 | + let $first := fn:collation-key("a") |
| 40 | + let $second := fn:collation-key("a") |
41 | 41 | return $first = $second
|
42 | 42 | };
|
43 | 43 |
|
44 | 44 | declare
|
45 | 45 | %test:assertTrue
|
46 |
| -function fnp:not-equal() { |
47 |
| - let $first := fn:collation-key("a", "http://www.w3.org/2013/collation/UCA?strength=primary") |
48 |
| - let $second := fn:collation-key("b", "http://www.w3.org/2013/collation/UCA?strength=primary") |
| 46 | +function fnck:default-not-equal() { |
| 47 | + let $first := fn:collation-key("a") |
| 48 | + let $second := fn:collation-key("b") |
| 49 | + return $first != $second |
| 50 | +}; |
| 51 | + |
| 52 | +declare |
| 53 | + %test:assertTrue |
| 54 | +function fnck:default-not-equal-ignore-case() { |
| 55 | + let $first := fn:collation-key("a") |
| 56 | + let $second := fn:collation-key("A") |
| 57 | + return $first != $second |
| 58 | +}; |
| 59 | + |
| 60 | +declare |
| 61 | + %test:assertTrue |
| 62 | +function fnck:exist-equal() { |
| 63 | + let $first := fn:collation-key("a", "http://exist-db.org/collation") |
| 64 | + let $second := fn:collation-key("a", "http://exist-db.org/collation") |
| 65 | + return $first = $second |
| 66 | +}; |
| 67 | + |
| 68 | +declare |
| 69 | + %test:assertTrue |
| 70 | +function fnck:exist-equal-ignore-case() { |
| 71 | + let $first := fn:collation-key("a", "http://exist-db.org/collation") |
| 72 | + let $second := fn:collation-key("A", "http://exist-db.org/collation") |
| 73 | + return $first = $second |
| 74 | +}; |
| 75 | + |
| 76 | +declare |
| 77 | + %test:assertTrue |
| 78 | +function fnck:exist-not-equal() { |
| 79 | + let $first := fn:collation-key("a", "http://exist-db.org/collation") |
| 80 | + let $second := fn:collation-key("b", "http://exist-db.org/collation") |
| 81 | + return $first != $second |
| 82 | +}; |
| 83 | + |
| 84 | +declare |
| 85 | + %test:assertError("FOCH0002") |
| 86 | +function fnck:invalid-uri() { |
| 87 | + fn:collation-key("a", "") |
| 88 | +}; |
| 89 | + |
| 90 | +declare |
| 91 | + %test:assertTrue |
| 92 | +function fnck:uca-equal() { |
| 93 | + let $first := fn:collation-key("a", "http://www.w3.org/2013/collation/UCA") |
| 94 | + let $second := fn:collation-key("a", "http://www.w3.org/2013/collation/UCA") |
| 95 | + return $first = $second |
| 96 | +}; |
| 97 | + |
| 98 | +declare |
| 99 | + %test:assertTrue |
| 100 | +function fnck:uca-equal-ignore-case() { |
| 101 | + let $first := fn:collation-key("a", "http://www.w3.org/2013/collation/UCA") |
| 102 | + let $second := fn:collation-key("A", "http://www.w3.org/2013/collation/UCA") |
| 103 | + return $first = $second |
| 104 | +}; |
| 105 | + |
| 106 | +declare |
| 107 | + %test:assertTrue |
| 108 | +function fnck:uca-not-equal() { |
| 109 | + let $first := fn:collation-key("a", "http://www.w3.org/2013/collation/UCA") |
| 110 | + let $second := fn:collation-key("b", "http://www.w3.org/2013/collation/UCA") |
49 | 111 | return $first != $second
|
50 | 112 | };
|
0 commit comments