File tree Expand file tree Collapse file tree 1 file changed +16
-21
lines changed
exist-core/src/main/resources/org/exist/xquery/lib/xqsuite Expand file tree Collapse file tree 1 file changed +16
-21
lines changed Original file line number Diff line number Diff line change @@ -905,31 +905,26 @@ declare %private function test:assertTrue($result as item()*) as element(report)
905
905
</report>
906
906
};
907
907
908
+ declare %private function test:safe-effective-boolean-value ($result as item ()*) as xs:boolean {
909
+ try {
910
+ boolean ($result)
911
+ } catch err:FORG0006 {
912
+ false ()
913
+ }
914
+ };
915
+
908
916
(:~
909
917
: Check if the function caused an error.
910
918
:)
911
919
declare %private function test:assertError ($value as xs:string, $result as item ()*) as element (report)? {
912
- let $ebv :=
913
- try {
914
- if ($result)
915
- then
916
- fn:true ()
917
- else
918
- fn:false ()
919
- } catch err:FORG0006 {
920
- fn:false ()
921
- }
922
- return
923
-
924
- if ($ebv)
925
- then
926
- ()
927
- else
928
- <report>
929
- <failure message = "assertError failed. Expected error {$value} "
930
- type = "failure-error-code-1" />
931
- <output>{ $result }</output>
932
- </report>
920
+ if (test:safe-effective-boolean-value ($result))
921
+ then ()
922
+ else
923
+ <report>
924
+ <failure message = "assertError failed. Expected error {$value} "
925
+ type = "failure-error-code-1" />
926
+ <output>{ $result }</output>
927
+ </report>
933
928
};
934
929
935
930
(:~
You can’t perform that action at this time.
0 commit comments