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
…120)

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.

Co-authored-by: Jean Boussier <[email protected]>
  • Loading branch information
casperisfine and byroot authored Mar 15, 2024
1 parent 77cb0dc commit d4e79f2
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 d4e79f2

Please sign in to comment.