aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_prettyprint.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_prettyprint.rb')
-rw-r--r--test/test_prettyprint.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/test_prettyprint.rb b/test/test_prettyprint.rb
index 1d6b75a569..0d087b4a78 100644
--- a/test/test_prettyprint.rb
+++ b/test/test_prettyprint.rb
@@ -1,3 +1,5 @@
+# -*- frozen_string_literal: true -*-
+
require 'prettyprint'
require 'test/unit'
@@ -14,7 +16,7 @@ class WadlerExample < Test::Unit::TestCase # :nodoc:
end
def hello(width)
- PrettyPrint.format('', width) {|hello|
+ PrettyPrint.format(''.dup, width) {|hello|
hello.group {
hello.group {
hello.group {
@@ -81,7 +83,7 @@ End
end
def tree(width)
- PrettyPrint.format('', width) {|q| @tree.show(q)}
+ PrettyPrint.format(''.dup, width) {|q| @tree.show(q)}
end
def test_tree_00_19
@@ -126,7 +128,7 @@ End
end
def tree_alt(width)
- PrettyPrint.format('', width) {|q| @tree.altshow(q)}
+ PrettyPrint.format(''.dup, width) {|q| @tree.altshow(q)}
end
def test_tree_alt_00_18
@@ -242,7 +244,7 @@ end
class StrictPrettyExample < Test::Unit::TestCase # :nodoc:
def prog(width)
- PrettyPrint.format('', width) {|q|
+ PrettyPrint.format(''.dup, width) {|q|
q.group {
q.group {q.nest(2) {
q.text "if"; q.breakable;
@@ -387,7 +389,7 @@ end
class TailGroup < Test::Unit::TestCase # :nodoc:
def test_1
- out = PrettyPrint.format('', 10) {|q|
+ out = PrettyPrint.format(''.dup, 10) {|q|
q.group {
q.group {
q.text "abc"
@@ -426,7 +428,7 @@ end
class Fill < Test::Unit::TestCase # :nodoc:
def format(width)
- PrettyPrint.format('', width) {|q|
+ PrettyPrint.format(''.dup, width) {|q|
q.group {
q.text 'abc'
q.fill_breakable