Closed Bug 1097874 Opened 10 years ago Closed 10 years ago

the message logged when assert.throws fails is confusing when a regular expression is used

Categories

(Add-on SDK Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: evold, Assigned: evold)

References

Details

Attachments

(1 file)

At the moment a failing assert.throw() which uses a reg exp looks like: console.error: addon-sdk: fail: Setting a pref to [] should raise error - { // /can't set pref test_set_pref to value ''; it isn't a string, integer, or boolean/ "__proto__": { // /(?:)/ } } throws "can't set pref test_set_pref to value ''; it isn't a String, Number, or Boolean" It should look like: console.error: addon-sdk: fail: Setting a pref to [] should raise error - "/can't set pref test_set_pref to value ''; it isn't a string, integer, or boolean/" does not match message "can't set pref test_set_pref to value ''; it isn't a String, Number, or Boolean"
Note: discovered when working on bug 1092882
Assignee: nobody → evold
Attachment #8521610 - Flags: review?(jsantell) → review+
Commits pushed to master at https://github.com/mozilla/addon-sdk https://github.com/mozilla/addon-sdk/commit/fd3ebd4854de5cf56143358e2bd116caf47b86dc Bug 1097874 assert.throws expected value is messy when a reg exp is used https://github.com/mozilla/addon-sdk/commit/786929089f8b7f3548f75c5e0f4ac17ace3a7d6b Merge pull request #1709 from erikvold/1097874 Bug 1097874 assert.throws expected value is messy when a reg exp is used r=@jsantell
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: