summaryrefslogtreecommitdiff
path: root/digital/avr/modules/path/astar/test/test_astar.pl
diff options
context:
space:
mode:
authorNicolas Schodet2010-04-23 00:34:18 +0200
committerNicolas Schodet2010-04-23 00:34:18 +0200
commitc199bfa0012d763f1e4684c3cd0ab6c07134ddce (patch)
treebc517cf3303a1ac63ac335e4781b69dd1016ac28 /digital/avr/modules/path/astar/test/test_astar.pl
parent98a10d5c181d40f8ea3d600d712ed249417a963e (diff)
digital/avr/modules/path/astar: new A* module
Diffstat (limited to 'digital/avr/modules/path/astar/test/test_astar.pl')
-rw-r--r--digital/avr/modules/path/astar/test/test_astar.pl22
1 files changed, 22 insertions, 0 deletions
diff --git a/digital/avr/modules/path/astar/test/test_astar.pl b/digital/avr/modules/path/astar/test/test_astar.pl
new file mode 100644
index 00000000..88fcc984
--- /dev/null
+++ b/digital/avr/modules/path/astar/test/test_astar.pl
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+my @tests = (
+ [ 'iX___',
+ '_X_X_',
+ '___Xg' ],
+ [ '0X_4_',
+ '1X3X5',
+ '_2_X6' ],
+ );
+
+while (@tests)
+{
+ my @in = @{shift @tests};
+ my @out = @{shift @tests};
+ open OUT, "./test_astar.host @in|" or die;
+ my @r = grep s{^// }{}, <OUT>;
+ chomp @r;
+ die unless "@r" eq "@out";
+}