Class | WadlerExample
In: | prettyprint.rb
Parent: | Test::Unit::TestCase

### Methods

hello setup test_hello_00_06 test_hello_07_08 test_hello_09_10 test_hello_11_12 test_hello_13 test_tree_00_19 test_tree_20_22 test_tree_23_43 test_tree_44 test_tree_alt_00_18 test_tree_alt_19_20 test_tree_alt_20_49 test_tree_alt_50 tree tree_alt

### Classes and Modules

Class WadlerExample::Tree

### Public Instance methods

hello(width)

[Source]

    # File prettyprint.rb, line 412
        def hello(width)
          PrettyPrint.format('', width) {|hello|
            hello.group {
              hello.group {
                hello.group {
                  hello.group {
                    hello.text 'hello'
                    hello.breakable; hello.text 'a'
                  }
                  hello.breakable; hello.text 'b'
                }
                hello.breakable; hello.text 'c'
              }
              hello.breakable; hello.text 'd'
            }
          }
        end

setup()

[Source]

    # File prettyprint.rb, line 403
        def setup
          @tree = Tree.new("aaaa", Tree.new("bbbbb", Tree.new("ccc"),
                                                     Tree.new("dd")),
                                   Tree.new("eee"),
                                   Tree.new("ffff", Tree.new("gg"),
                                                    Tree.new("hhh"),
                                                    Tree.new("ii")))
        end

test_hello_00_06()

[Source]

    # File prettyprint.rb, line 430
        def test_hello_00_06
          expected = "hello\na\nb\nc\nd\n".chomp
          assert_equal(expected, hello(0))
          assert_equal(expected, hello(6))
        end

test_hello_07_08()

[Source]

    # File prettyprint.rb, line 443
        def test_hello_07_08
          expected = "hello a\nb\nc\nd\n".chomp
          assert_equal(expected, hello(7))
          assert_equal(expected, hello(8))
        end

test_hello_09_10()

[Source]

    # File prettyprint.rb, line 455
        def test_hello_09_10
          expected = "hello a b\nc\nd\n".chomp
          out = hello(9); assert_equal(expected, out)
          out = hello(10); assert_equal(expected, out)
        end

test_hello_11_12()

[Source]

    # File prettyprint.rb, line 466
        def test_hello_11_12
          expected = "hello a b c\nd\n".chomp
          assert_equal(expected, hello(11))
          assert_equal(expected, hello(12))
        end

test_hello_13()

[Source]

    # File prettyprint.rb, line 476
        def test_hello_13
          expected = "hello a b c d\n".chomp
          assert_equal(expected, hello(13))
        end

test_tree_00_19()

[Source]

    # File prettyprint.rb, line 488
        def test_tree_00_19
          expected = "aaaa[bbbbb[ccc,\n           dd],\n     eee,\n     ffff[gg,\n          hhh,\n          ii]]\n".chomp
          assert_equal(expected, tree(0))
          assert_equal(expected, tree(19))
        end

test_tree_20_22()

[Source]

    # File prettyprint.rb, line 502
        def test_tree_20_22
          expected = "aaaa[bbbbb[ccc, dd],\n     eee,\n     ffff[gg,\n          hhh,\n          ii]]\n".chomp
          assert_equal(expected, tree(20))
          assert_equal(expected, tree(22))
        end

test_tree_23_43()

[Source]

    # File prettyprint.rb, line 515
        def test_tree_23_43
          expected = "aaaa[bbbbb[ccc, dd],\n     eee,\n     ffff[gg, hhh, ii]]\n".chomp
          assert_equal(expected, tree(23))
          assert_equal(expected, tree(43))
        end

test_tree_44()

[Source]

    # File prettyprint.rb, line 526
        def test_tree_44
          assert_equal("aaaa[bbbbb[ccc, dd], eee, ffff[gg, hhh, ii]]\n".chomp, tree(44))
        end

test_tree_alt_00_18()

[Source]

    # File prettyprint.rb, line 537
        def test_tree_alt_00_18
          expected = "aaaa[\n  bbbbb[\n    ccc,\n    dd\n  ],\n  eee,\n  ffff[\n    gg,\n    hhh,\n    ii\n  ]\n]\n".chomp
          assert_equal(expected, tree_alt(0))
          assert_equal(expected, tree_alt(18))
        end

test_tree_alt_19_20()

[Source]

    # File prettyprint.rb, line 557
        def test_tree_alt_19_20
          expected = "aaaa[\n  bbbbb[ ccc, dd ],\n  eee,\n  ffff[\n    gg,\n    hhh,\n    ii\n  ]\n]\n".chomp
          assert_equal(expected, tree_alt(19))
          assert_equal(expected, tree_alt(20))
        end

test_tree_alt_20_49()

[Source]

    # File prettyprint.rb, line 574
        def test_tree_alt_20_49
          expected = "aaaa[\n  bbbbb[ ccc, dd ],\n  eee,\n  ffff[ gg, hhh, ii ]\n]\n".chomp
          assert_equal(expected, tree_alt(21))
          assert_equal(expected, tree_alt(49))
        end

test_tree_alt_50()

[Source]

    # File prettyprint.rb, line 587
        def test_tree_alt_50
          expected = "aaaa[ bbbbb[ ccc, dd ], eee, ffff[ gg, hhh, ii ] ]\n".chomp
          assert_equal(expected, tree_alt(50))
        end

tree(width)

[Source]

    # File prettyprint.rb, line 484
        def tree(width)
          PrettyPrint.format('', width) {|q| @tree.show(q)}
        end

tree_alt(width)

[Source]

    # File prettyprint.rb, line 533
        def tree_alt(width)
          PrettyPrint.format('', width) {|q| @tree.altshow(q)}
        end

[Validate]