Skip to content

Commit

Permalink
Make the test suite compatible with --enable-frozen-string-literal
Browse files Browse the repository at this point in the history
Ref: https://bugs.ruby-lang.org/issues/20205

Since `rexml` is tested as part of ruby-core CI, it needs to be compatible
with the `--enable-frozen-string-literal` option.
  • Loading branch information
byroot committed Mar 15, 2024
1 parent 77cb0dc commit 240166b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ jobs:
- name: Test
run: bundle exec rake test

frozen-string-literal:
name: frozen-string-literal
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ruby
bundler-cache: true
- name: Test
run: bundle exec rake test RUBYOPT="--enable-frozen-string-literal"

gem:
name: "Gem: ${{ matrix.ruby-version }} on ${{ matrix.runs-on }}"
runs-on: ${{ matrix.runs-on }}
Expand Down
2 changes: 1 addition & 1 deletion test/formatter/test_default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module REXMLTests
class DefaultFormatterTest < Test::Unit::TestCase
def format(node)
formatter = REXML::Formatters::Default.new
output = ""
output = +""
formatter.write(node, output)
output
end
Expand Down

0 comments on commit 240166b

Please sign in to comment.