summaryrefslogtreecommitdiffstats
path: root/t/lib/Test/Games/SMTNocturne/Demons.pm
diff options
context:
space:
mode:
Diffstat (limited to 't/lib/Test/Games/SMTNocturne/Demons.pm')
-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;