Closed Bug 928185 Opened 9 years ago Closed 9 years ago
IScriptable Unicode Converter .convert To Input Stream could use an automated test
I haven't actually run this patch yet, but I based it on a xpcshell run with manual testing.
Comment on attachment 818785 [details] [diff] [review] Test converting from JS string to UTF-8 input stream and back ... and if I had tested, it would've failed with a rather obvious error. D'oh! New patch coming with fix as soon as possible.
I need some help. This patch passes on Windows 7, but fails on Fedora Linux when run as ./mach xpcshell-test: UnicodeDecodeError: 'ascii' codec can't decode byte 0xfd in position 181: ordinal not in range(128) But when I run it through ./mach xpcshell-test --interactive, it passes. The UnicodeDecodeError is apparently coming from Python, not from JS code.
Obvious fix: use do_check_true(original === result) instead of do_check_eq(original, result).
Comment on attachment 819377 [details] [diff] [review] Test converting from JS string to UTF-8 input stream and back Review of attachment 819377 [details] [diff] [review]: ----------------------------------------------------------------- I was sure I had commented on this already :-S ::: intl/uconv/tests/unit/test_input_stream.js @@ +20,5 @@ > + /* Python bug: UnicodeDecodeError: 'ascii' codec can't decode byte 0xfd in position 181: ordinal not in range(128) > + do_check_eq(original, result); > + */ > + do_check_true(original === result); > +} This isn't great for finding what's gone wrong if the test fails. How about |do_check_eq(escape(original), escape(result))| like I do in a lot of the other tests here?
Attachment #819377 - Flags: review?(smontagu) → review+
Attachment #819377 - Attachment is obsolete: true
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
You need to log in before you can comment on or make changes to this bug.