2021-04-02 16:06:26 +02:00
|
|
|
#!/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;
|
|
|
|
|
2021-04-04 01:17:18 +02:00
|
|
|
my $parsed = Minilisp::compile_file($scriptfile);
|
2021-04-02 16:06:26 +02:00
|
|
|
|
|
|
|
my $plan = 0;
|
|
|
|
|
|
|
|
my $ctx = {
|
|
|
|
'expect' => sub {
|
|
|
|
my ($desc, $success) = @_;
|
|
|
|
print "not " unless $success;
|
|
|
|
print "ok - $desc\n";
|
|
|
|
$plan++;
|
2021-04-05 00:25:53 +02:00
|
|
|
},
|
|
|
|
comment => sub {
|
|
|
|
my ($v) = @_;
|
|
|
|
print "# " . Minilisp::lisp_format($v) . "\n";
|
|
|
|
},
|
2021-04-02 16:06:26 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
print "TAP Version 13\n";
|
|
|
|
$parsed->($ctx);
|
|
|
|
|
2021-04-02 19:02:00 +02:00
|
|
|
die "No tests" unless $plan > 0;
|
2021-04-02 16:06:26 +02:00
|
|
|
print "1..$plan\n";
|
|
|
|
|
|
|
|
exit 0;
|