This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27608 - Regular expressions in JSON Serialization tests
Summary: Regular expressions in JSON Serialization tests
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite (show other bugs)
Version: Working drafts
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: O'Neil Delpratt
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-13 17:06 UTC by Christian Gruen
Modified: 2016-05-11 21:50 UTC (History)
2 users (show)

See Also:


Attachments

Description Christian Gruen 2014-12-13 17:06:00 UTC
I believe that the regular expressions in the tests Serialization-json-58 – Serialization-json-72 need to be fixed, as many of them do not comply with the XQuery syntax. In most cases, it's about closing curly and square brackets that have not been escaped. Some other characters (parentheses, asterisk) need to be escaped as well. Some examples:

* Serialization-json-64

Curly and square brackets:

- OLD: \{"book":\{.*"author":\[{[^}]*},{[^}]*},{[^}]*}].*}}
- NEW: \{"book":\{.*"author":\[\{[^}]*\},\{[^}]*\},\{[^}]*\}\].*\}\}

* Serialization-json-60

Parentheses:

- OLD: \{"menu":\{.*"popup":\{"menuitem":\[\{.*"onclick":"CreateNewDoc()".*},\{.*"onclick":"OpenDoc()".*},\{.*"onclick":"CloseDoc()".*}]}.*}}
- NEW: \{"menu":\{.*"popup":\{"menuitem":\[\{.*"onclick":"CreateNewDoc\(\)".*\},\{.*"onclick":"OpenDoc\(\)".*\},\{.*"onclick":"CloseDoc\(\)".*\}\]\}.*\}\}

* Serialization-json-67

Forward slashes (should not be escaped):

- OLD: \{"book":\{.*"author":\[{[^}]*},{[^}]*},"<simple>2<\/simple>",{[^}]*}].*}}
- NEW: \{"book":\{.*"author":\[\{[^}]*\},\{[^}]*\},"<simple>2</simple>",\{[^}]*\}\].*\}\}

* Serialization-json-61

Asterisks:

- OLD: "text":\{.*"onMouseUp":"sun1\.opacity = \(sun1\.opacity / 100\) * 90;".*}
- NEW: "text":\{.*"onMouseUp":"sun1\.opacity = \(sun1\.opacity / 100\) \* 90;".*\}
Comment 1 Christian Gruen 2014-12-13 17:11:38 UTC
One more comment on Serialization-json-68:

The <node-key>strange</node-key> will be atomized (according to the spec, 3.10.1.1), so the serialized result will look as follows:

  ... "strange":"<simple>2</simple>" ...
Comment 2 Josh Spiegel 2014-12-31 20:33:57 UTC
I agree with Christian.
Comment 3 Christian Gruen 2015-01-27 12:59:27 UTC
Fixed, changes committed.
Comment 4 Michael Kay 2015-04-13 09:16:12 UTC
I found some further cases of closing square brackets that were not escaped, and have fixed them.
Comment 5 Josh Spiegel 2016-05-11 21:23:56 UTC
It looks like this assertion is wrong:

<serialization-matches>"text":\{.*"vOffset":250.*\}</serialization-matches>

https://github.com/LeoWoerteler/QT3TS/blob/master/ser/json/data003.json

This may or may not pass depending on the order of the map entries.  

It should be. 

<serialization-matches>"text":\{.*"vOffset":100.*\}</serialization-matches>
Comment 6 Josh Spiegel 2016-05-11 21:24:43 UTC
Comment 5 is referring to Serialization-json-61
Comment 7 Josh Spiegel 2016-05-11 21:50:12 UTC
Fixed.