-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get tests passing with frozen-string-literals enabled. #149
Conversation
Though this does require patches for test-unit, as covered in test-unit/test-unit#149.
For the tests to pass, this requires the use of the latest RSpec commits, along with submitted patches to simplecov-html and test-unit: * simplecov-ruby/simplecov-html#56 * test-unit/test-unit#149
I don't understand why test-unit should support frozen string literals yet. |
The frozen string literals feature - from what I understand - has been added with performance in mind. Essentially, to avoid allocating duplicate strings many times in memory. I realise that it's not a critical feature right now, but especially since test-unit is a dependency in many other gems, having this library work when |
Thanks. It's reasonable. Using many |
Thanks for fixing this :) Once gettext is updated as well, the build should be green 👍 |
I've released 3.2.5. |
Thank you! |
701: Get tests passing with frozen-string-literals enabled. r=badboy This one simple change ensure that all string literals can be frozen (as per the optional feature in MRI 2.3 and onwards). @twalpole has (again) beaten me to such a patch (in #590), though mine (again) does not add the pragma comment to all files. Getting their or my PRs merged in would be excellent :) As an alternative to the pragma comment, I would recommend adding the following to your .travis.yml file to ensure regressions aren't introduced: ```yml before_script: - if (ruby -e "exit RUBY_VERSION.to_f >= 2.4"); then export RUBYOPT="--enable-frozen-string-literal"; fi; echo $RUBYOPT ``` This will add the flag when the tests are run on MRI 2.4 or newer (while the feature was introduced in 2.3, it doesn't seem to work reliably until 2.4). Please note: tests will currently fail when this flag is set unless test-unit is also updated (as noted in test-unit/test-unit#149).
640: Add new master_name param for sentinel. Fixes #531 r=badboy Associated with issue #531. Based on #534 with the addition of tests. Didn't know how to keep @nguyenductung 's commit sadly but this PR does fix the issue and is tested. 701: Get tests passing with frozen-string-literals enabled. r=badboy This one simple change ensure that all string literals can be frozen (as per the optional feature in MRI 2.3 and onwards). @twalpole has (again) beaten me to such a patch (in #590), though mine (again) does not add the pragma comment to all files. Getting their or my PRs merged in would be excellent :) As an alternative to the pragma comment, I would recommend adding the following to your .travis.yml file to ensure regressions aren't introduced: ```yml before_script: - if (ruby -e "exit RUBY_VERSION.to_f >= 2.4"); then export RUBYOPT="--enable-frozen-string-literal"; fi; echo $RUBYOPT ``` This will add the flag when the tests are run on MRI 2.4 or newer (while the feature was introduced in 2.3, it doesn't seem to work reliably until 2.4). Please note: tests will currently fail when this flag is set unless test-unit is also updated (as noted in test-unit/test-unit#149).
701: Get tests passing with frozen-string-literals enabled. r=badboy This one simple change ensure that all string literals can be frozen (as per the optional feature in MRI 2.3 and onwards). @twalpole has (again) beaten me to such a patch (in #590), though mine (again) does not add the pragma comment to all files. Getting their or my PRs merged in would be excellent :) As an alternative to the pragma comment, I would recommend adding the following to your .travis.yml file to ensure regressions aren't introduced: ```yml before_script: - if (ruby -e "exit RUBY_VERSION.to_f >= 2.4"); then export RUBYOPT="--enable-frozen-string-literal"; fi; echo $RUBYOPT ``` This will add the flag when the tests are run on MRI 2.4 or newer (while the feature was introduced in 2.3, it doesn't seem to work reliably until 2.4). Please note: tests will currently fail when this flag is set unless test-unit is also updated (as noted in test-unit/test-unit#149).
701: Get tests passing with frozen-string-literals enabled. r=badboy This one simple change ensure that all string literals can be frozen (as per the optional feature in MRI 2.3 and onwards). @twalpole has (again) beaten me to such a patch (in #590), though mine (again) does not add the pragma comment to all files. Getting their or my PRs merged in would be excellent :) As an alternative to the pragma comment, I would recommend adding the following to your .travis.yml file to ensure regressions aren't introduced: ```yml before_script: - if (ruby -e "exit RUBY_VERSION.to_f >= 2.4"); then export RUBYOPT="--enable-frozen-string-literal"; fi; echo $RUBYOPT ``` This will add the flag when the tests are run on MRI 2.4 or newer (while the feature was introduced in 2.3, it doesn't seem to work reliably until 2.4). Please note: tests will currently fail when this flag is set unless test-unit is also updated (as noted in test-unit/test-unit#149).
701: Get tests passing with frozen-string-literals enabled. r=badboy This one simple change ensure that all string literals can be frozen (as per the optional feature in MRI 2.3 and onwards). @twalpole has (again) beaten me to such a patch (in #590), though mine (again) does not add the pragma comment to all files. Getting their or my PRs merged in would be excellent :) As an alternative to the pragma comment, I would recommend adding the following to your .travis.yml file to ensure regressions aren't introduced: ```yml before_script: - if (ruby -e "exit RUBY_VERSION.to_f >= 2.4"); then export RUBYOPT="--enable-frozen-string-literal"; fi; echo $RUBYOPT ``` This will add the flag when the tests are run on MRI 2.4 or newer (while the feature was introduced in 2.3, it doesn't seem to work reliably until 2.4). Please note: tests will currently fail when this flag is set unless test-unit is also updated (as noted in test-unit/test-unit#149).
Though this does require patches for test-unit, as covered in test-unit/test-unit#149.
701: Get tests passing with frozen-string-literals enabled. r=badboy This one simple change ensure that all string literals can be frozen (as per the optional feature in MRI 2.3 and onwards). @twalpole has (again) beaten me to such a patch (in #590), though mine (again) does not add the pragma comment to all files. Getting their or my PRs merged in would be excellent :) As an alternative to the pragma comment, I would recommend adding the following to your .travis.yml file to ensure regressions aren't introduced: ```yml before_script: - if (ruby -e "exit RUBY_VERSION.to_f >= 2.4"); then export RUBYOPT="--enable-frozen-string-literal"; fi; echo $RUBYOPT ``` This will add the flag when the tests are run on MRI 2.4 or newer (while the feature was introduced in 2.3, it doesn't seem to work reliably until 2.4). Please note: tests will currently fail when this flag is set unless test-unit is also updated (as noted in test-unit/test-unit#149).
These changes ensure that all string literals can be frozen (as per the optional feature in MRI 2.3 and onwards). I would recommend adding the following to your
.travis.yml
file to ensure regressions aren't introduced:This will add the flag when the tests are run on MRI 2.4 or newer (while the feature was introduced in 2.3, it doesn't seem to work reliably until 2.4). Please note: tests will currently fail when this flag is set unless
gettext
is also updated (I will submit a PR there too).