Join GitHub today
throws-like should die on Bool:D matchers #2364
This is following #2363 that got closed...
Above, the test writer specified they expect
Quoted from #2363:
The named matchers in throws-like are smartmatched against the received Exception's methods and smartmatch against False is always False. To properly test for a Bool:D value you'd use (for example) * === False or * === True WhateverCode.
I think the change that should be made is to watch for Bool:D matchers and throw, the same as how we do with .grep for example:
$ perl6 -e '().grep: True'
(N.B.: I don't really want it to do === test automatically for Bool:D matchers, as that breaks expectations of how smartmatch works elsewhere; best to consistently re-enforce that message)