I am writing a new Perl 6 project for work, and would like to be able to test whether all parts can be use
d correctly. For this, I'm using the use-ok
subroutine from the Test
module. I'm trying to easily test all module files using the following code:
"META6.json".IO.slurp.&from-json<provides>
.grep(*.value.starts-with("lib")).Hash.keys
.map({ use-ok $_ })
My issue here is that there are a few files that contain a definition for a MAIN
subroutine. From the output I see when running prove -e 'perl6 -Ilib' t
, it looks like one of the files is having their MAIN
executed, and then the testing stops.
I want to test whether these files can be use
d correctly, without actually running the MAIN
subs that are defined within them. How would I do this?