#!/usr/bin/perl -w use strict; my %tests = ( "hello.eta" => "", "hello2.eta" => "", "fact.eta" => "7", "bottles.eta" => "", "crlf.eta" => "", "pip.eta" => "To be or not to be\nthat is the question", "pip2.eta" => "Donuts, is there anything they can't do?", ); my $status = 0; foreach my $file (keys %tests) { print "Running $file: "; my $ref_out = `echo "$tests{$file}" | ./eta $file`; my $out = `echo "$tests{$file}" | java -cp .. eta $file`; if ($ref_out eq $out) { print "passed\n"; } else { print "FAILED\n"; $status = 1; } } exit $status;