diff options
Diffstat (limited to 't/010-useability.t')
-rw-r--r-- | t/010-useability.t | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/t/010-useability.t b/t/010-useability.t new file mode 100644 index 0000000..81abfe7 --- /dev/null +++ b/t/010-useability.t @@ -0,0 +1,32 @@ +# -*- mode: perl -*- + +use Test::More tests => 3; + +## this tests the useability of the package +## also, tests the version number of bzlib, although the +## boot code should bail if the version isn't right + +BEGIN { + use_ok('Compress::Bzip2'); +}; + +my $fail; +foreach my $constname (qw( + BZ_CONFIG_ERROR BZ_DATA_ERROR BZ_DATA_ERROR_MAGIC BZ_FINISH + BZ_FINISH_OK BZ_FLUSH BZ_FLUSH_OK BZ_IO_ERROR BZ_MAX_UNUSED + BZ_MEM_ERROR BZ_OK BZ_OUTBUFF_FULL BZ_PARAM_ERROR BZ_RUN BZ_RUN_OK + BZ_SEQUENCE_ERROR BZ_STREAM_END BZ_UNEXPECTED_EOF)) { + next if (eval "my \$a = $constname; 1"); + if ($@ =~ /^Your vendor has not defined Compress::Bzip2 macro $constname/) { + print "# pass: $@"; + } else { + print "# fail: $@"; + $fail = 1; + } +} + +ok( !$fail, "constants imported ok" ); + +my $version = bzlibversion(); +ok( $version && $version =~ /^1\./, "bzlib version is $version" ); + |