Tk Library Source Code

View Ticket
Login
Ticket UUID: 1844104
Title: json test suite failures against tcl 8.5
Type: Bug Version: None
Submitter: lvirden Created on: 2007-12-04 14:39:52
Subsystem: json Assigned To: andreas_kupries
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2007-12-06 07:39:02
Resolution: Fixed Closed By: andreas_kupries
    Closed on: 2007-12-06 00:39:02
Description:
Platform: sparc solaris 9
tcl: cvs head 8.5
tcllib: cvs head

The following tests failed:
==== json-1.1 test JSON widget FAILED
==== Contents of test case:
set res [json::json2dict $JSON(widget)]
---- Result was:
widget {debug on window {title {Sample Widget} name main_window width 500 height
 500} text {data {Click Here} size 36 style bold name null hOffset 250 vOffset 1
00 alignment center onMouseUp {sun1.opacity = (sun1.opacity / 100) * 90;}}}
---- Result should have been (exact matching):
widget {window {width 500 height 500 name main_window title {Sample Widget}} tex
t {vOffset 100 name null style bold data {Click Here} onMouseUp {sun1.opacity = 
(sun1.opacity / 100) * 90;} alignment center hOffset 250 size 36} debug on}
==== json-1.1 FAILED

==== json-1.2 test JSON glossary FAILED
==== Contents of test case:
set res [json::json2dict $JSON(glossary)]
---- Result was:
glossary {title {example glossary} mixlist {{a "" str} -0.09 null {} {member tru
e}} GlossDiv {title S GlossList {{ID SGML GlossTerm {Standard \" Language} Acron
ym SGML\\ Abbrev {ISO 8879:1986} GlossDef {A meta-markup language, used ...} Glo
ssSeeAlso {GML XML markup}}}}}
---- Result should have been (exact matching):
glossary {mixlist {{a "" str} -0.09 null {} {member true}} title {example glossa
ry} GlossDiv {GlossList {{GlossSeeAlso {GML XML markup} GlossTerm {Standard \" L
anguage} Acronym SGML\\ ID SGML Abbrev {ISO 8879:1986} GlossDef {A meta-markup l
anguage, used ...}}} title S}}
==== json-1.2 FAILED

==== json-1.4 test JSON menu FAILED
==== Contents of test case:
set res [json::json2dict $JSON(menu)]
---- Result was:
menu {id file value File: unival ?: popup {menuitem {{value Open onclick OpenDoc
()} {value Close onclick CloseDoc()}}}}
---- Result should have been (exact matching):
menu {popup {menuitem {{value Open onclick OpenDoc()} {value Close onclick Close
Doc()}}} value File: id file unival ?:}
==== json-1.4 FAILED



==== json-1.8 test JSON menu2 FAILED
==== Contents of test case:
set res [json::json2dict $JSON(menu2)]
---- Result was:
menu {header Viewer items {{id Open} {id OpenNew label {Open New}} null {id Zoom
In label {Zoom In}} {id ZoomOut label {Zoom Out}} null {id Help} {id About label
 {About Viewer...}}}}
---- Result should have been (exact matching):
menu {header Viewer items {{id Open} {label {Open New} id OpenNew} null {label {
Zoom In} id ZoomIn} {label {Zoom Out} id ZoomOut} null {id Help} {label {About V
iewer...} id About}}}
==== json-1.8 FAILED


==== json-1.9 test JSON array FAILED
==== Contents of test case:
set res [json::json2dict $JSON(array)]
---- Result was:
{precision zip Latitude 37.7668 Longitude -122.3959 Address {} City {SAN FRANCIS
CO} State CA Zip 94107 Country US} {precision zip Latitude 37.371991 Longitude -
122.026020 Address {} City SUNNYVALE State CA Zip 94085 Country US}
---- Result should have been (exact matching):
{Country US Latitude 37.7668 precision zip State CA City {SAN FRANCISCO} Address
 {} Zip 94107 Longitude -122.3959} {Country US Latitude 37.371991 precision zip 
State CA City SUNNYVALE Address {} Zip 94085 Longitude -122.026020}
==== json-1.9 FAILED
User Comments: andreas_kupries added on 2007-12-06 07:39:02:
Logged In: YES 
user_id=75003
Originator: NO

Committed updated tests to CVS. Note: The tests can run with a Tcl 8.4 using the backported dict package. This combination will now fail as the backported dict does not have the ordering changes of the Tcl 8.5 dict. either the backport has to be updated, or the testsuite has to get two tests per actual test, one per variant.

andreas_kupries added on 2007-12-04 23:49:02:
Logged In: YES 
user_id=75003
Originator: NO

This seems to be a dict'ionary ordering thing. The tcllib testsuite support provides a 'dictsort' command to generate a canonical representation, whatever the ordering returned by Tcl. This is not as important any longer now that dicts are keeping insertion order. It was originally made because Tcl 8.4 and 8.5 returned dicts and arrays in differing orders due to changes in the underlying hash(table).