我遇到了处理带有行尾字符的字符串的functx模块的问题。以下代码应该可以工作(?)
declare %unit:test function test:substring-before-last() {
let $title := 'Something
blah other'
let $expected-title := 'Something
blah'
return unit:assert-equals(functx:substring-before-last($title, ' other'),
$expected-title)
};
但是它失败了
“Something blah”预期,“Something blah other”返回。
删除换行符使测试正常工作。我不明白什么?:)
BR