summaryrefslogtreecommitdiffstats
path: root/t/lib
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-05-25 03:38:11 -0400
committerJesse Luehrs <doy@tozt.net>2014-05-25 03:38:21 -0400
commitfc00f92dd845e4fd1c7057a5eae696b71c15c7ca (patch)
tree0975bfcf77272c4e62a9267cc301337fb2d60a52 /t/lib
parentd233d8e2c9503e0be1906081fa30a845c64109ba (diff)
downloadgames-smtnocturne-demons-fc00f92dd845e4fd1c7057a5eae696b71c15c7ca.tar.gz
games-smtnocturne-demons-fc00f92dd845e4fd1c7057a5eae696b71c15c7ca.zip
start adding tests
not all of them pass yet, since not everything is implemented properly yet
Diffstat (limited to 't/lib')
-rw-r--r--t/lib/Test/Games/SMTNocturne/Demons.pm28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/lib/Test/Games/SMTNocturne/Demons.pm b/t/lib/Test/Games/SMTNocturne/Demons.pm
new file mode 100644
index 0000000..5ccd8ac
--- /dev/null
+++ b/t/lib/Test/Games/SMTNocturne/Demons.pm
@@ -0,0 +1,28 @@
+package Test::Games::SMTNocturne::Demons;
+use strict;
+use warnings;
+use Exporter 'import';
+
+use Games::SMTNocturne::Demons;
+use Test::More;
+
+our @EXPORT = ('fusion_is');
+
+sub fusion_is {
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+ my ($demon1, $demon2, $expected) = @_;
+
+ my $fused = eval { Games::SMTNocturne::Demons::fuse($demon1, $demon2) };
+
+ die $@ if $@ && $@ !~ /\bnyi\b/;
+ local $TODO = $@ if $@;
+
+ if ($fused) {
+ is($fused->name, $expected);
+ }
+ else {
+ is(undef, $expected);
+ }
+}
+
+1;