Fix improper handling of expression name
This commit is contained in:
parent
cab0cb5ce1
commit
6971949a53
|
@ -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;
|
||||
|
|
|
@ -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 = $<name>.Str;
|
||||
my @tests;
|
||||
for $contents.match(&flagged-expression, :g) -> $match {
|
||||
@tests.push($match<test-name>.Str);
|
||||
my $test =
|
||||
Test.new(name => $match<test-name>.Str,
|
||||
expr => $match<expression-name>.Str);
|
||||
@tests.push($test);
|
||||
}
|
||||
if @tests.elems > 0 {
|
||||
%tests{$module-name} =
|
||||
|
|
Loading…
Reference in a new issue