diff --git a/bin/iutils b/bin/iutils index 2000339..d4dc3c1 100755 --- a/bin/iutils +++ b/bin/iutils @@ -43,9 +43,9 @@ multi MAIN( for $module.tests -> $test { try { # FIXME this doesn't actually capture the exit code - idris-exec $test, $module.source.relative; + idris-exec $test.expr, $module.source.relative; } - my $testf = colored $test, 'underline'; + my $testf = colored $test.name, 'underline'; if $! { # TODO: Don't show stdout if its empty $module-failures += 1; diff --git a/lib/IUtils.rakumod b/lib/IUtils.rakumod index 9d7f1df..620c700 100644 --- a/lib/IUtils.rakumod +++ b/lib/IUtils.rakumod @@ -7,6 +7,14 @@ use IUtils::Regexes; use paths; +#| Structure representing a test +class Test { + #| The name of the test + has Str:D $.name is required; + #| The expression name of the test + has Str:D $.expr is required; +} + #| Structure representing the tests in a module class ModuleTests { #| The name of this module @@ -14,7 +22,7 @@ class ModuleTests { #| The source file of this module has IO::Path:D $.source is required; #| A list of the associated tests this module has - has Str:D @.tests is required; + has Test:D @.tests is required; } #| Structure representing all of the runables assocated with a project @@ -43,7 +51,10 @@ class PackageInfo { my $module-name = $.Str; my @tests; for $contents.match(&flagged-expression, :g) -> $match { - @tests.push($match.Str); + my $test = + Test.new(name => $match.Str, + expr => $match.Str); + @tests.push($test); } if @tests.elems > 0 { %tests{$module-name} =