Browse Source

Added basic helper::dmup tests

Alois Mahdal 11 years ago
parent
commit
bf670e6a9f
2 changed files with 39 additions and 0 deletions
  1. 13
    0
      t/00_use.t
  2. 26
    0
      t/01_dump.t

+ 13
- 0
t/00_use.t View File

@@ -0,0 +1,13 @@
1
+#!/usr/bin/perl
2
+use strict;
3
+use warnings;
4
+
5
+use Test::More;
6
+
7
+use lib 'lib';
8
+
9
+BEGIN { use_ok('helper'); }
10
+require_ok('helper');
11
+
12
+done_testing();
13
+

+ 26
- 0
t/01_dump.t View File

@@ -0,0 +1,26 @@
1
+#!/usr/bin/perl
2
+use strict;
3
+use warnings;
4
+
5
+use Test::More;
6
+
7
+use lib 'lib';
8
+use helper;
9
+
10
+my $string = "hello";
11
+my $int = 3;
12
+my @array = qw/ dad mom /;
13
+my %hash = (
14
+    orange => "orange",
15
+    apple => "red"
16
+);
17
+sub do_something { return "actually nothing at all" }
18
+
19
+ok(&helper::dmup(string => \$string),       "dump a string");
20
+ok(&helper::dmup(int => \$int),             "dump an int");
21
+ok(&helper::dmup(array => \@array),         "dump an array");
22
+ok(&helper::dmup(hash => \%hash),           "dump a hash");
23
+ok(&helper::dmup(sub => \&do_something),    "dump a sub");
24
+
25
+done_testing();
26
+