Closed Bug 357352 Opened 18 years ago Closed 18 years ago

e4x/Namespace/regress-350442.js is too strict

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: inonit, Assigned: Waldo)

Details

Attachments

(1 file, 2 obsolete files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 In the JavaScript Test Library, the regression test for Bug#350442 requires that the implementation choose "ns2" as the namespace prefix for the namespace "http://ns2" A conforming implementation ought to be able to choose any namespace it likes. Reproducible: Always Two ways to fix this, one hard, one easy. I'll attach a patch for the easy one. The hard way would be to do more robust comparisons when evaluating these tests for passage, i.e., to use XML equality rather than string equality. Of course then we could have more subtle regressions if the XML equality stuff breaks. The quicker, dirtier solution is to specify the namespace prefix in the test, which is what I propose in my patch.
A one-liner.
no need to cc me on js bugs. With this change, the test fails on trunk with: BUGNUMBER: 350442 STATUS: toXMLString with namespace definitions FAILED!: Section 1 of test - FAILED!: Expected value: FAILED!: <tag1 ns2:a1="a1 from ns2" xmlns="http://ns1" xmlns:ns2="http://ns2"/> FAILED!: Actual value: FAILED!: <tag1 ns2:a1="a1 from ns2" xmlns="http://ns1"/> FAILED!: Igor?
Summary: Regression test for Bug#350442 is too strict → e4x/Namespace/regress-350442.js is too strict
I think this should do the trick, barring extreme and unusual spec violations by the implementation being tested. David, does this look spec-compatible to you?
Assignee: general → jwalden+bmo
Attachment #242828 - Attachment is obsolete: true
Status: UNCONFIRMED → ASSIGNED
Attachment #242957 - Flags: review?(inonit)
(In reply to comment #2) > With this change, the test fails on trunk with: > BUGNUMBER: 350442 > > STATUS: toXMLString with namespace definitions > FAILED!: Section 1 of test - > FAILED!: Expected value: > FAILED!: <tag1 ns2:a1="a1 from ns2" xmlns="http://ns1" xmlns:ns2="http://ns2"/> > FAILED!: Actual value: > FAILED!: <tag1 ns2:a1="a1 from ns2" xmlns="http://ns1"/> > FAILED!: Hmm, that's a bug somewhere -- filed bug 357471 on it.
Yes, I think the proposed patch catches most plausible cases, and most cases that would pass the test but be wrong (having a prefix defined to be the wrong namespace, etc.) are pretty implausible. Sorry it took me so long to get back on this.
Don't worry about the delay; everyone's busy, and I still need to act on the wiki stuff you posted nearly a month ago. :-\ Thanks for taking the time to look at it. I noticed when looking at this again that the method used to get the prefix is greedy; this version changes that to be "non-greedy" so that the prefix extraction would work even if another prefixed namespace declaration were added (there's no actual effect on current execution): var s = '<t xmlns:a="f" xmlns:b="g" b:f="7"/>'; /xmlns:(.+)="g"/.exec(s)[1] == 'a="f" xmlns:b'; // true /xmlns:([^=]+)="g"/.exec(s)[1] == 'b'; // true The change made is as above: "([^=]+)" instead of "(.+)". I'll commit the fix in a second...
Attachment #242957 - Attachment is obsolete: true
Attachment #242957 - Flags: review?(inonit)
Patch checked in on trunk.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Flags: in-testsuite+
test passes 20061122 1.8.1.1/1.9
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: