# WadlerExample (Class)

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

setup()

[Source]

    # File prettyprint.rb, line 400
        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

hello(width)

[Source]

    # File prettyprint.rb, line 409
        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

test_hello_00_06()

[Source]

    # File prettyprint.rb, line 427
        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 440
        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 452
        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 463
        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 473
        def test_hello_13
          expected = "hello a b c d\n".chomp
          assert_equal(expected, hello(13))
        end

tree(width)

[Source]

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

test_tree_00_19()

[Source]

    # File prettyprint.rb, line 485
        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 499
        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 512
        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 523
        def test_tree_44
          assert_equal("aaaa[bbbbb[ccc, dd], eee, ffff[gg, hhh, ii]]\n".chomp, tree(44))
        end

tree_alt(width)

[Source]

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

test_tree_alt_00_18()

[Source]

    # File prettyprint.rb, line 534
        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 554
        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 571
        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 584
        def test_tree_alt_50
          expected = "aaaa[ bbbbb[ ccc, dd ], eee, ffff[ gg, hhh, ii ] ]\n".chomp
          assert_equal(expected, tree_alt(50))
        end

[Validate]