35 lines
529 B
Perl
Executable file
35 lines
529 B
Perl
Executable file
#!/usr/bin/env perl
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
use FindBin;
|
|
|
|
use lib "$FindBin::Bin/../lib";
|
|
|
|
use Minilisp;
|
|
|
|
my $scriptfile = shift;
|
|
|
|
die "No script file provided." unless defined $scriptfile && -f $scriptfile;
|
|
|
|
my $parsed = Minilisp::compile_file($scriptfile);
|
|
|
|
my $plan = 0;
|
|
|
|
my $ctx = {
|
|
'expect' => sub {
|
|
my ($desc, $success) = @_;
|
|
print "not " unless $success;
|
|
print "ok - $desc\n";
|
|
$plan++;
|
|
}
|
|
};
|
|
|
|
print "TAP Version 13\n";
|
|
$parsed->($ctx);
|
|
|
|
die "No tests" unless $plan > 0;
|
|
print "1..$plan\n";
|
|
|
|
exit 0;
|