01_dump.t 585B

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