# PPCycleTest (Class)

In: | pp.rb
Parent: | Test::Unit::TestCase

## Methods

test_anonymous test_array test_hash test_object test_share_nil test_struct test_withinspect

## Constants

S | = | Struct.new("S", :a, :b)

## Public Instance methods

test_array()

[Source]

    # File pp.rb, line 549
        def  test_arraytest_array
          a = []
          a << a
          assert_equal("[[...]]\n", PP.pp(a, ''))
        end

test_hash()

[Source]

    # File pp.rb, line 555
        def test_hash
          a = {}
          a[0] = a
          assert_equal("{0=>{...}}\n", PP.pp(a, ''))
        end

test_struct()

[Source]

    # File pp.rb, line 562
        def test_struct
          a = S.new(1,2)
          a.b = a
          assert_equal("#<Struct::S a=1, b=#<Struct::S:...>>\n", PP.pp(a, ''))
        end

test_object()

[Source]

    # File pp.rb, line 568
        def test_object
          a = Object.new
          a.instance_eval {@a = a}
          assert_equal(a.inspect + "\n", PP.pp(a, ''))
        end

test_anonymous()

[Source]

    # File pp.rb, line 574
        def test_anonymous
          a = Class.new.new
          assert_equal(a.inspect + "\n", PP.pp(a, ''))
        end

test_withinspect()

[Source]

    # File pp.rb, line 579
        def test_withinspect
          a = []
          a << HasInspect.new(a)
          assert_equal("[<inspect:[...]>]\n", PP.pp(a, ''))
        end

test_share_nil()

[Source]

    # File pp.rb, line 585
        def test_share_nil
          begin
            PP.sharing_detection = true
            a = [nil, nil]
            assert_equal("[nil, nil]\n", PP.pp(a, ''))
          ensure
            PP.sharing_detection = false
          end
        end

[Validate]