Properly support multi-word test names

This commit is contained in:
Nathan McCarty 2024-12-31 20:40:00 -05:00
parent 4b2c2eb4dd
commit c8acc534a9
2 changed files with 3 additions and 2 deletions

View file

@ -95,7 +95,7 @@ class PackageInfo {
when * eq 'Either' {succeed Either};
};
my $test =
Test.new(name => $match<test-name>.Str,
Test.new(name => $match<test-name>.Str.trim,
expr => $match<expression-name>.Str,
output-type => $output-type);
@tests.push($test);

View file

@ -10,11 +10,12 @@ my token output-type {
my token comment-start { \- \- }
my token flag { \@ \@ <type> }
my token name { <[\w \-]>+ }
my token test-name { \V+ }
my token comment-line { <&comment-start> \V* \v }
my regex flagged-expression is export {
<&comment-start> \h* <flag> \h* <test-name=&name> \V* \v
\h* <&comment-start> \h* <flag> \h* <test-name> \V* \v
<comment-line>*
<expression-name=&name> \h+ \: \h+ 'IO' \h+ <output-type> \V* \v
}