Improve <null> handling in Test::More.pir #538

aghast opened this Issue Feb 17, 2010 · 1 comment

1 participant


I had occasion to pass some null values to Test::More's is() multisub, and got an unexpected fault - NULL pmc access, etc.

Bacek mentioned in the commit comments to cs# [43660] that discussion was needed on how Test::More handles null, so I have created this ticket to host that discussion.

To get started, I am committing a patch (cs# [44058]) that adds is_null as a test assertion, as well as adding support for null values to the various is() multisub elements.

I think that "null happens", which is especially vexing when calling from NQP to PIR. So I think that any assertion that accepts a PMC type must support the possibility that the PMC type will be null.

I have implemented "null equivalence" -- that is, null==null, for the assertions. I know this can be argued both ways.

Obvious leftovers include the creation of isnt_null and adding null support to the isnt assertions, as well as devising a null policy for the other assertions. The is_deeply seems to do something with null, but that's about it.



(Edited to include my patch number)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment