re00737 fails

Bug #1131990 reported by Paul J. Lucas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
Critical
Paul J. Lucas

Bug Description

The FOTS test re00737:

    (every $s in tokenize('', ',')
      satisfies matches($s, '^(?:[^cde-[ag]]+)$'))
    and
    (every $s in tokenize('agbfxyzga', ',')
      satisfies not(matches($s, '^(?:[^cde-[ag]]+)$')))

fails. It may be due to the interaction between negative characters classes and range subtraction. This may be a limitation of ICU.

Tags: fots

Related branches

Changed in zorba:
importance: Undecided → Critical
milestone: none → 2.9
summary: - FOTS: re00737 fails
+ re00737 fails
Changed in zorba:
status: Triaged → New
Chris Hillery (ceejatec)
tags: removed: regex
description: updated
Changed in zorba:
assignee: Paul J. Lucas (paul-lucas) → Markos Zaharioudakis (markos-za)
Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

It turns out that the failure has nothing to do with regular expressions. The query:

    matches("","^(?:[^cde-[ag]]+)$")

correctly returns false because the empty string "" does not match one or more ('+') characters that are not [cde]. However the query:

    every $s in tokenize("",",") satisfies matches($s,"^(?:[^cde-[ag]]+)$")

incorrectly returns true. Setting a breakpoint in strings_impl.cpp:1521 does nothing because in the latter case, the code never gets there so matches() is never called. Why not?

Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

The correct reuslt for the query

every $s in tokenize("",",") satisfies matches($s,"^(?:[^cde-[ag]]+)$")

is indeed true. This is because tokenize("", ",") returns the empty sequence, and as a result the whole "every" expression returns true (without the need to evaluate the fn:match()).

Changed in zorba:
assignee: Markos Zaharioudakis (markos-za) → Paul J. Lucas (paul-lucas)
Changed in zorba:
status: New → In Progress
Changed in zorba:
status: In Progress → Fix Committed
Changed in zorba:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.