Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix up test so it executes in a reasonable time.

  • Loading branch information...
commit 5d6e0e0980e058e57aea0b1a6a4936e43ee8c587 1 parent 90e224a
@colomon authored
Showing with 15 additions and 8 deletions.
  1. +15 −8 t/04-read-files.t
View
23 t/04-read-files.t
@@ -2,8 +2,7 @@ use v6;
use Test;
use ISO_10303_21::Grammar;
-my @files = qx[find t/CAx -iname "*.s*p" -print].lines;
-@files .= grep(none /boot.stp/, /clamp.stp/, /"s1-ug-203.stp"/);
+my @files = ('t/CAx/as1-id-203.stp', 't/CAx/conrod.stp', 't/CAx/s1-id-214.stp');
for @files -> $file {
say "Reading $file";
@@ -12,18 +11,26 @@ for @files -> $file {
my $match = ISO_10303_21::Grammar.parse($file-data, :rule<exchange_file>);
isa_ok $match, Match, "<exchange_file> matches $file - 1";
ok $match, "<exchange_file> matches $file - 2";
+
+ $match = ISO_10303_21::LooseGrammar.parse($file-data, :rule<exchange_file>);
+ isa_ok $match, Match, "LooseGrammar.<exchange_file> matches $file - 1";
+ ok $match, "LooseGrammar.<exchange_file> matches $file - 2";
}
-@files .= pick(3);
-@files.push('t/CAx/boot.stp', 't/CAx/clamp.stp', 't/CAx/s1-ug-203.stp');
+@files = ('t/CAx/boot.stp', 't/CAx/clamp.stp', 't/CAx/s1-ug-203.stp');
for @files -> $file {
say "Reading $file";
my $file-data = slurp($file);
$file-data .= subst(/"/*" .*? "*/"/, " ", :global);
- my $match = ISO_10303_21::LooseGrammar.parse($file-data, :rule<exchange_file>);
- isa_ok $match, Match, "<exchange_file> matches $file - 1";
- ok $match, "<exchange_file> matches $file - 2";
+
+ my $match = ISO_10303_21::Grammar.parse($file-data, :rule<exchange_file>);
+ isa_ok $match, Match, "Grammar.<exchange_file> returns a Match for $file...";
+ nok $match, "... but it does not match";
+
+ $match = ISO_10303_21::LooseGrammar.parse($file-data, :rule<exchange_file>);
+ isa_ok $match, Match, "LooseGrammar.<exchange_file> matches $file - 1";
+ ok $match, "LooseGrammar.<exchange_file> matches $file - 2";
}
-done;
+done;
Please sign in to comment.
Something went wrong with that request. Please try again.