Closed Bug 714467 Opened 13 years ago Closed 10 years ago

do_check_n/eq should perform strict equality check

Categories

(Testing :: XPCShell Harness, defect)

12 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: asaf, Unassigned)

Details

do_check_eq seems to perform regular equality check. I have a use case for strict equality check (for now I'm just using do_check_true), and I think that switching all tests to work this way is better in general.
Actually, if we're going to change this (and I'd love to see this changed), we should change to "sameness", not strict equality.  Sameness would treat NaN as identical to NaN, -0 as identical to -0 but not to +0, and +0 as identical to +0 but not -0.  The SameValue definition in js/src/tests/shell.js implements this:

http://hg.mozilla.org/mozilla-central/annotate/a447e66c3174/js/src/tests/shell.js#l266
Works for me.

I'll try to patch it on try sometime this week and see how much it burns.
do_check_n/eq are now deprecated in favor of (not)equal, and (not)deepEqual, which are what I asked for here (albeit they do much more than a simple === check). It's somewhat unfortunate that the deep checks are opt-in, but that's not going to change.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
Oh, and there are also (not)strictEqual, which do simple ===/!== checks.
You need to log in before you can comment on or make changes to this bug.