in reply to Re^3: How to completely destroy class attributes with Test::Most?
in thread How to completely destroy class attributes with Test::Most?
I will go through this a little bit at a time.
And lastly, I present a trick I just figured out and used in some of my own code: (not fully tested yet)
... sub new { # whatever new actually does {our $_total_constructed; $_total_constructed++} # return object } ... sub DESTROY { our $_total_destroyed; $_total_destroyed++ }
The test suite is then able to ensure that no references have leaked by simply comparing the $_total_constructed and $_total_destroyed package variables.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: How to completely destroy class attributes with Test::Most?
by nysus (Parson) on Aug 26, 2019 at 04:15 UTC | |
by jcb (Parson) on Aug 26, 2019 at 04:43 UTC | |
by nysus (Parson) on Aug 26, 2019 at 14:32 UTC | |
by jcb (Parson) on Aug 26, 2019 at 22:34 UTC | |
by nysus (Parson) on Aug 27, 2019 at 23:56 UTC | |
| |
by nysus (Parson) on Aug 26, 2019 at 12:49 UTC |