From fc00f92dd845e4fd1c7057a5eae696b71c15c7ca Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 25 May 2014 03:38:11 -0400 Subject: start adding tests not all of them pass yet, since not everything is implemented properly yet --- t/lib/Test/Games/SMTNocturne/Demons.pm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 t/lib/Test/Games/SMTNocturne/Demons.pm (limited to 't/lib') 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; -- cgit v1.2.3-54-g00ecf