This project is archived and is in readonly mode.
Correct Regexp extension un/optionalize assertions and fix failures masked by false positives
Reported by Jeffrey Hardy | August 26th, 2009 @ 07:41 PM | in 2.3.4
This patch corrects the Regexp extension un/optionalize test
assertions. Previously, assert
was being used instead
of assert_equal, producing false positives.
- assert "", Regexp.optionalize("")
+ assert_equal "", Regexp.optionalize("")
The first will always pass since "" evaluates to true. It's
clear that the original author intended
assert_equal
.
Fixing the assertions uncovered a failure which this patch also fixes:
test_optionalize(RegexpExtAccessTests)
[./test/core_ext/regexp_ext_test.rb:18:in `test_optionalize'
<""> expected but was
<"(?:)?">.
Since the previous return value of /(?:)?/ will still match an empty string, behavior is unchanged (all Action Pack tests continue to pass), but based on the tests, "" was the return value the author intended.
Comments and changes to this ticket
-
Jeremy Kemper August 26th, 2009 @ 10:40 PM
- State changed from new to open
- Milestone set to 2.3.4
Fixed on master, needs 2-3-stable backport since it lives in AP there
-
Repository August 26th, 2009 @ 10:55 PM
- State changed from open to incomplete
(from [66d8063c910b166e58f77ca5149a454f721667c7]) Correct Regexp#un/optionalize assertions and fix uncovered failures
[#3102 state:incomplete]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/66d8063c910b166e58f77ca5149a45... -
Jeremy Kemper August 26th, 2009 @ 11:43 PM
- State changed from incomplete to resolved
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 3102 Correct Regexp extension un/optionalize assertions and fix failures masked by false positives [#3102 state:incomplete]