marklogic-community / roxy

Deployment tool for MarkLogic applications. Also provides optional unit test and XQuery MVC structure
Other
87 stars 66 forks source link

Assert False does not accept helper message #861

Open rjkennedy98 opened 7 years ago

rjkennedy98 commented 7 years ago

Assert False does not accept helper message

Assert False should have a 2 argument function with helper message

Assert False should have a 2 argument function with helper message. This is there for Assert True, but is missing for assert false.

Code below shows the assert-true with $msg as item()* but that is missing for assert-false.

declare function helper:assert-true($supposed-truths as xs:boolean*, $msg as item()*) {
  if (fn:false() = $supposed-truths) then
    fn:error(xs:QName("ASSERT-TRUE-FAILED"), "Assert True failed", $msg)
  else
    helper:success()
};

declare function helper:assert-false($supposed-falsehoods as xs:boolean*) {
  if (fn:true() = $supposed-falsehoods) then
    fn:error(xs:QName("ASSERT-FALSE-FAILED"), "Assert False failed", $supposed-falsehoods)
  else
    helper:success()
};