Skip to content

Commit d4e79f2

Browse files
casperisfinebyroot
andauthored
Make the test suite compatible with --enable-frozen-string-literal (#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 <jean.boussier@gmail.com>
1 parent 77cb0dc commit d4e79f2

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ jobs:
3333
- name: Test
3434
run: bundle exec rake test
3535

36+
frozen-string-literal:
37+
name: frozen-string-literal
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
- uses: ruby/setup-ruby@v1
42+
with:
43+
ruby-version: ruby
44+
bundler-cache: true
45+
- name: Test
46+
run: bundle exec rake test RUBYOPT="--enable-frozen-string-literal"
47+
3648
gem:
3749
name: "Gem: ${{ matrix.ruby-version }} on ${{ matrix.runs-on }}"
3850
runs-on: ${{ matrix.runs-on }}

test/formatter/test_default.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module REXMLTests
22
class DefaultFormatterTest < Test::Unit::TestCase
33
def format(node)
44
formatter = REXML::Formatters::Default.new
5-
output = ""
5+
output = +""
66
formatter.write(node, output)
77
output
88
end

0 commit comments

Comments
 (0)