Ticket #1453 (new cage) — at Version 1

Opened 12 years ago

Last modified 11 years ago

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

Reported by: Austin_Hastings Owned by:
Priority: normal Milestone:
Component: none Version: 2.0.0
Severity: medium Keywords: Test::More, null
Cc: Language:
Patch status: Platform:

Description (last modified by Austin_Hastings) (diff)

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.

Change History

Changed 12 years ago by Austin_Hastings

  • description modified (diff)

(Edited to include my patch number)

Note: See TracTickets for help on using tickets.