Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1113)

Issue 6869007: Cleanup of mjsunit.js code and make assertEquals more strict. (Closed)

Created:
9 years, 8 months ago by Lasse Reichstein
Modified:
9 years, 6 months ago
CC:
v8-dev
Visibility:
Public.

Description

Cleanup of mjsunit.js code and make assertEquals more strict. Encapsulate the helper functions in mjsunit.js. Now only exposes the exception class and the assertXXX functions. Make assertEquals use === instead of ==. This prevents a lot of possiblefalse positives in tests, and avoids having to do assertTrue(expected === actual) when you need it. Fixed some tests that were either buggy or assuming == test. Committed: http://code.google.com/p/v8/source/detail?r=7628

Patch Set 1 #

Patch Set 2 : Tweak assertEquals some more. #

Total comments: 12

Patch Set 3 : Addressed review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5405 lines, -5310 lines) Patch
M test/mjsunit/apply.js View 3 chunks +30 lines, -30 lines 0 comments Download
M test/mjsunit/arguments-apply.js View 1 chunk +4 lines, -4 lines 0 comments Download
M test/mjsunit/arguments-opt.js View 1 chunk +11 lines, -9 lines 0 comments Download
M test/mjsunit/array-length.js View 1 chunk +1 line, -1 line 0 comments Download
M test/mjsunit/compiler/logical-and.js View 1 chunk +2 lines, -2 lines 0 comments Download
M test/mjsunit/const.js View 1 chunk +6 lines, -6 lines 0 comments Download
M test/mjsunit/cyrillic.js View 1 chunk +3 lines, -3 lines 0 comments Download
M test/mjsunit/debug-scopes.js View 42 chunks +74 lines, -70 lines 0 comments Download
M test/mjsunit/math-abs.js View 2 chunks +7 lines, -7 lines 0 comments Download
M test/mjsunit/math-min-max.js View 2 chunks +6 lines, -6 lines 0 comments Download
M test/mjsunit/mirror-number.js View 1 chunk +2 lines, -2 lines 0 comments Download
M test/mjsunit/mirror-object.js View 1 2 3 chunks +11 lines, -6 lines 0 comments Download
M test/mjsunit/mjsunit.js View 1 2 1 chunk +253 lines, -176 lines 0 comments Download
M test/mjsunit/number-string-index-call.js View 1 chunk +2 lines, -2 lines 0 comments Download
M test/mjsunit/number-tostring.js View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M test/mjsunit/object-seal.js View 3 chunks +4 lines, -4 lines 0 comments Download
M test/mjsunit/override-eval-with-non-function.js View 1 chunk +1 line, -1 line 0 comments Download
M test/mjsunit/regexp.js View 5 chunks +13 lines, -13 lines 0 comments Download
M test/mjsunit/regexp-capture.js View 1 chunk +11 lines, -10 lines 0 comments Download
M test/mjsunit/regexp-compile.js View 1 chunk +4 lines, -4 lines 0 comments Download
M test/mjsunit/regexp-static.js View 1 chunk +2 lines, -1 line 0 comments Download
M test/mjsunit/regexp-string-methods.js View 2 chunks +5 lines, -5 lines 0 comments Download
M test/mjsunit/regress/regress-1199637.js View 1 chunk +8 lines, -8 lines 0 comments Download
M test/mjsunit/regress/regress-176.js View 1 chunk +21 lines, -21 lines 0 comments Download
M test/mjsunit/regress/regress-187.js View 1 chunk +1 line, -1 line 0 comments Download
M test/mjsunit/regress/regress-399.js View 1 chunk +1 line, -1 line 0 comments Download
M test/mjsunit/string-fromcharcode.js View 1 chunk +4 lines, -2 lines 0 comments Download
M test/mjsunit/string-index.js View 2 chunks +2 lines, -2 lines 0 comments Download
M test/mjsunit/third_party/object-keys.js View 1 chunk +1 line, -1 line 0 comments Download
M test/mjsunit/third_party/regexp-pcre.js View 2 chunks +4906 lines, -4906 lines 0 comments Download
M test/mjsunit/tools/codemap.js View 2 chunks +4 lines, -1 line 0 comments Download
M test/mjsunit/tools/splaytree.js View 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Lasse Reichstein
9 years, 8 months ago (2011-04-15 09:22:11 UTC) #1
Søren Thygesen Gjesse
LGTM http://codereview.chromium.org/6869007/diff/2001/test/mjsunit/mirror-object.js File test/mjsunit/mirror-object.js (right): http://codereview.chromium.org/6869007/diff/2001/test/mjsunit/mirror-object.js#newcode143 test/mjsunit/mirror-object.js:143: } Should we test that there actually is ...
9 years, 8 months ago (2011-04-15 10:20:51 UTC) #2
Lasse Reichstein
9 years, 8 months ago (2011-04-15 11:33:54 UTC) #3
http://codereview.chromium.org/6869007/diff/2001/test/mjsunit/mirror-object.js
File test/mjsunit/mirror-object.js (right):

http://codereview.chromium.org/6869007/diff/2001/test/mjsunit/mirror-object.j...
test/mjsunit/mirror-object.js:143: }
let's.
Also, it seems I need to handle that NaN and Infinity are strings.

http://codereview.chromium.org/6869007/diff/2001/test/mjsunit/mirror-object.j...
test/mjsunit/mirror-object.js:158: }1
Removed the spurious "1".

http://codereview.chromium.org/6869007/diff/2001/test/mjsunit/mjsunit.js
File test/mjsunit/mjsunit.js (right):

http://codereview.chromium.org/6869007/diff/2001/test/mjsunit/mjsunit.js#newc...
test/mjsunit/mjsunit.js:248: assertEquals(expected[i], found[i], start + "array
element at index " + i);
Wrapped.

http://codereview.chromium.org/6869007/diff/2001/test/mjsunit/regexp-static.js
File test/mjsunit/regexp-static.js (right):

http://codereview.chromium.org/6869007/diff/2001/test/mjsunit/regexp-static.j...
test/mjsunit/regexp-static.js:137: assertEquals(["foo",undefined],
/foo(?:a(x))?/.exec("foobx"),
Not necessary, and not more readable.

http://codereview.chromium.org/6869007/diff/2001/test/mjsunit/regress/regress...
File test/mjsunit/regress/regress-176.js (right):

http://codereview.chromium.org/6869007/diff/2001/test/mjsunit/regress/regress...
test/mjsunit/regress/regress-176.js:30: assertArrayEquals(["f", undefined],
Not necessaary.

Powered by Google App Engine
This is Rietveld 408576698