exiftool-vendored.exe 12.82.0 → 12.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/bin/exiftool.exe +0 -0
- package/bin/exiftool_files/Changes +37 -0
- package/bin/exiftool_files/Licenses_Strawberry_Perl.zip +0 -0
- package/bin/exiftool_files/README +3 -2
- package/bin/exiftool_files/build_geolocation +872 -0
- package/bin/exiftool_files/config_files/example.config +2 -2
- package/bin/exiftool_files/exiftool.pl +28 -6
- package/bin/exiftool_files/fmt_files/gpx.fmt +2 -1
- package/bin/exiftool_files/fmt_files/gpx_wpt.fmt +2 -1
- package/bin/exiftool_files/lib/Archive/Zip/Archive.pm +399 -65
- package/bin/exiftool_files/lib/Archive/Zip/DirectoryMember.pm +1 -1
- package/bin/exiftool_files/lib/Archive/Zip/FileMember.pm +1 -1
- package/bin/exiftool_files/lib/Archive/Zip/Member.pm +499 -195
- package/bin/exiftool_files/lib/Archive/Zip/NewFileMember.pm +1 -1
- package/bin/exiftool_files/lib/Archive/Zip/StringMember.pm +2 -2
- package/bin/exiftool_files/lib/Archive/Zip/ZipFileMember.pm +79 -20
- package/bin/exiftool_files/lib/Archive/Zip.pm +179 -29
- package/bin/exiftool_files/lib/AutoLoader.pm +453 -0
- package/bin/exiftool_files/lib/B/Deparse.pm +209 -137
- package/bin/exiftool_files/lib/B.pm +1 -1
- package/bin/exiftool_files/lib/Benchmark.pm +1123 -0
- package/bin/exiftool_files/lib/Class/Struct.pm +2 -2
- package/bin/exiftool_files/lib/Compress/Raw/Bzip2.pm +14 -9
- package/bin/exiftool_files/lib/Compress/Raw/Lzma.pm +982 -0
- package/bin/exiftool_files/lib/Compress/Raw/Zlib.pm +91 -86
- package/bin/exiftool_files/lib/Compress/Zlib.pm +105 -100
- package/bin/exiftool_files/lib/Config.pm +9 -9
- package/bin/exiftool_files/lib/Config_heavy.pl +36 -33
- package/bin/exiftool_files/lib/CryptX.pm +2 -82
- package/bin/exiftool_files/lib/Data/Dumper.pm +2 -2
- package/bin/exiftool_files/lib/Digest/MD5.pm +12 -9
- package/bin/exiftool_files/lib/Digest/Perl/MD5.pm +1 -191
- package/bin/exiftool_files/lib/Digest/base.pm +26 -20
- package/bin/exiftool_files/lib/DynaLoader.pm +7 -4
- package/bin/exiftool_files/lib/Encode.pm +3 -3
- package/bin/exiftool_files/lib/Errno.pm +13 -13
- package/bin/exiftool_files/lib/Exporter/Heavy.pm +2 -2
- package/bin/exiftool_files/lib/Exporter.pm +1 -1
- package/bin/exiftool_files/lib/ExtUtils/Command/MM.pm +323 -0
- package/bin/exiftool_files/lib/ExtUtils/Command.pm +382 -0
- package/bin/exiftool_files/lib/File/Find.pm +1 -1
- package/bin/exiftool_files/lib/File/Glob.pm +1 -8
- package/bin/exiftool_files/lib/File/GlobMapper.pm +2 -2
- package/bin/exiftool_files/lib/File/HomeDir/Darwin/Carbon.pm +2 -40
- package/bin/exiftool_files/lib/File/HomeDir/Darwin/Cocoa.pm +2 -34
- package/bin/exiftool_files/lib/File/HomeDir/Darwin.pm +2 -28
- package/bin/exiftool_files/lib/File/HomeDir/Driver.pm +2 -35
- package/bin/exiftool_files/lib/File/HomeDir/FreeDesktop.pm +2 -62
- package/bin/exiftool_files/lib/File/HomeDir/MacOS9.pm +2 -53
- package/bin/exiftool_files/lib/File/HomeDir/Test.pm +2 -43
- package/bin/exiftool_files/lib/File/HomeDir/Unix.pm +2 -53
- package/bin/exiftool_files/lib/File/HomeDir/Windows.pm +2 -69
- package/bin/exiftool_files/lib/File/HomeDir.pm +5 -416
- package/bin/exiftool_files/lib/File/Path.pm +3 -3
- package/bin/exiftool_files/lib/File/Spec/Win32.pm +2 -2
- package/bin/exiftool_files/lib/File/Temp.pm +70 -35
- package/bin/exiftool_files/lib/File/Which.pm +1 -240
- package/bin/exiftool_files/lib/File/stat.pm +3 -2
- package/bin/exiftool_files/lib/IO/Compress/Adapter/Bzip2.pm +16 -17
- package/bin/exiftool_files/lib/IO/Compress/Adapter/Deflate.pm +19 -20
- package/bin/exiftool_files/lib/IO/Compress/Base/Common.pm +5 -5
- package/bin/exiftool_files/lib/IO/Compress/Base.pm +35 -26
- package/bin/exiftool_files/lib/IO/Compress/Brotli.pm +159 -0
- package/bin/exiftool_files/lib/IO/Compress/Bzip2.pm +50 -25
- package/bin/exiftool_files/lib/IO/Compress/Gzip/Constants.pm +6 -6
- package/bin/exiftool_files/lib/IO/Compress/Gzip.pm +58 -32
- package/bin/exiftool_files/lib/IO/Compress/RawDeflate.pm +63 -38
- package/bin/exiftool_files/lib/IO/Compress/Zlib/Extra.pm +20 -20
- package/bin/exiftool_files/lib/IO/Dir.pm +1 -1
- package/bin/exiftool_files/lib/IO/File.pm +1 -1
- package/bin/exiftool_files/lib/IO/Handle.pm +1 -21
- package/bin/exiftool_files/lib/IO/Pipe.pm +1 -1
- package/bin/exiftool_files/lib/IO/Seekable.pm +1 -1
- package/bin/exiftool_files/lib/IO/Select.pm +16 -2
- package/bin/exiftool_files/lib/IO/Socket/INET.pm +14 -9
- package/bin/exiftool_files/lib/IO/Socket/UNIX.pm +17 -1
- package/bin/exiftool_files/lib/IO/Socket.pm +474 -126
- package/bin/exiftool_files/lib/IO/String.pm +425 -0
- package/bin/exiftool_files/lib/IO/Uncompress/Adapter/Inflate.pm +13 -14
- package/bin/exiftool_files/lib/IO/Uncompress/Base.pm +142 -132
- package/bin/exiftool_files/lib/IO/Uncompress/Brotli.pm +119 -0
- package/bin/exiftool_files/lib/IO/Uncompress/Gunzip.pm +43 -37
- package/bin/exiftool_files/lib/IO/Uncompress/RawInflate.pm +49 -43
- package/bin/exiftool_files/lib/IO.pm +2 -2
- package/bin/exiftool_files/lib/Image/ExifTool/Apple.pm +51 -7
- package/bin/exiftool_files/lib/Image/ExifTool/BuildTagLookup.pm +5 -2
- package/bin/exiftool_files/lib/Image/ExifTool/CanonVRD.pm +18 -5
- package/bin/exiftool_files/lib/Image/ExifTool/DJI.pm +29 -0
- package/bin/exiftool_files/lib/Image/ExifTool/Exif.pm +19 -2
- package/bin/exiftool_files/lib/Image/ExifTool/GM.pm +17 -8
- package/bin/exiftool_files/lib/Image/ExifTool/Geolocation.dat +0 -0
- package/bin/exiftool_files/lib/Image/ExifTool/Geolocation.pm +163 -101
- package/bin/exiftool_files/lib/Image/ExifTool/Geotag.pm +18 -10
- package/bin/exiftool_files/lib/Image/ExifTool/Nikon.pm +7 -6
- package/bin/exiftool_files/lib/Image/ExifTool/QuickTime.pm +6 -1
- package/bin/exiftool_files/lib/Image/ExifTool/QuickTimeStream.pl +5 -0
- package/bin/exiftool_files/lib/Image/ExifTool/Sony.pm +15 -6
- package/bin/exiftool_files/lib/Image/ExifTool/TagLookup.pm +18 -9
- package/bin/exiftool_files/lib/Image/ExifTool/TagNames.pod +24 -5
- package/bin/exiftool_files/lib/Image/ExifTool/WriteQuickTime.pl +2 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Writer.pl +165 -132
- package/bin/exiftool_files/lib/Image/ExifTool/XMP2.pl +3 -0
- package/bin/exiftool_files/lib/Image/ExifTool.pm +45 -23
- package/bin/exiftool_files/lib/Image/ExifTool.pod +23 -14
- package/bin/exiftool_files/lib/List/Util.pm +97 -8
- package/bin/exiftool_files/lib/MIME/Base64.pm +5 -5
- package/bin/exiftool_files/lib/MIME/Charset/_Compat.pm +106 -0
- package/bin/exiftool_files/lib/MIME/Charset.pm +1303 -0
- package/bin/exiftool_files/lib/Math/BigFloat.pm +444 -27
- package/bin/exiftool_files/lib/Math/BigInt/Calc.pm +296 -313
- package/bin/exiftool_files/lib/Math/BigInt/FastCalc.pm +1 -1
- package/bin/exiftool_files/lib/Math/BigInt/GMP.pm +2 -115
- package/bin/exiftool_files/lib/Math/BigInt/LTM.pm +2 -24
- package/bin/exiftool_files/lib/Math/BigInt/Lib.pm +61 -32
- package/bin/exiftool_files/lib/Math/BigInt.pm +292 -107
- package/bin/exiftool_files/lib/POSIX.pm +1 -1
- package/bin/exiftool_files/lib/PerlIO/scalar.pm +41 -0
- package/bin/exiftool_files/lib/PerlIO.pm +397 -0
- package/bin/exiftool_files/lib/Portable/CPAN.pm +94 -94
- package/bin/exiftool_files/lib/Portable/Config.pm +94 -94
- package/bin/exiftool_files/lib/Portable/FileSpec.pm +180 -180
- package/bin/exiftool_files/lib/Portable/HomeDir.pm +110 -110
- package/bin/exiftool_files/lib/Portable/LoadYaml.pm +430 -430
- package/bin/exiftool_files/lib/Portable/minicpan.pm +55 -55
- package/bin/exiftool_files/lib/Portable.pm +246 -320
- package/bin/exiftool_files/lib/Scalar/Util.pm +9 -4
- package/bin/exiftool_files/lib/Socket.pm +16 -12
- package/bin/exiftool_files/lib/Storable.pm +1444 -1441
- package/bin/exiftool_files/lib/TAP/Base.pm +133 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Base.pm +467 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Color.pm +116 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Console/ParallelSession.pm +201 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Console/Session.pm +205 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Console.pm +100 -0
- package/bin/exiftool_files/lib/TAP/Formatter/File/Session.pm +95 -0
- package/bin/exiftool_files/lib/TAP/Formatter/File.pm +56 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Session.pm +220 -0
- package/bin/exiftool_files/lib/TAP/Harness/Beyond.pod +426 -0
- package/bin/exiftool_files/lib/TAP/Harness/Env.pm +215 -0
- package/bin/exiftool_files/lib/TAP/Harness.pm +1054 -0
- package/bin/exiftool_files/lib/TAP/Object.pm +155 -0
- package/bin/exiftool_files/lib/TAP/Parser/Aggregator.pm +414 -0
- package/bin/exiftool_files/lib/TAP/Parser/Grammar.pm +584 -0
- package/bin/exiftool_files/lib/TAP/Parser/Iterator/Array.pm +100 -0
- package/bin/exiftool_files/lib/TAP/Parser/Iterator/Process.pm +378 -0
- package/bin/exiftool_files/lib/TAP/Parser/Iterator/Stream.pm +116 -0
- package/bin/exiftool_files/lib/TAP/Parser/Iterator.pm +162 -0
- package/bin/exiftool_files/lib/TAP/Parser/IteratorFactory.pm +339 -0
- package/bin/exiftool_files/lib/TAP/Parser/Multiplexer.pm +194 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Bailout.pm +62 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Comment.pm +60 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Plan.pm +119 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Pragma.pm +62 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Test.pm +271 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Unknown.pm +48 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Version.pm +62 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/YAML.pm +61 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result.pm +297 -0
- package/bin/exiftool_files/lib/TAP/Parser/ResultFactory.pm +183 -0
- package/bin/exiftool_files/lib/TAP/Parser/Scheduler/Job.pm +127 -0
- package/bin/exiftool_files/lib/TAP/Parser/Scheduler/Spinner.pm +61 -0
- package/bin/exiftool_files/lib/TAP/Parser/Scheduler.pm +448 -0
- package/bin/exiftool_files/lib/TAP/Parser/Source.pm +381 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Executable.pm +184 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/File.pm +136 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Handle.pm +124 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Perl.pm +370 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/RawTAP.pm +130 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler.pm +191 -0
- package/bin/exiftool_files/lib/TAP/Parser/YAMLish/Reader.pm +332 -0
- package/bin/exiftool_files/lib/TAP/Parser/YAMLish/Writer.pm +254 -0
- package/bin/exiftool_files/lib/TAP/Parser.pm +1931 -0
- package/bin/exiftool_files/lib/Test/Builder/Formatter.pm +107 -0
- package/bin/exiftool_files/lib/Test/Builder/IO/Scalar.pm +659 -0
- package/bin/exiftool_files/lib/Test/Builder/Module.pm +182 -0
- package/bin/exiftool_files/lib/Test/Builder/Tester/Color.pm +51 -0
- package/bin/exiftool_files/lib/Test/Builder/Tester.pm +675 -0
- package/bin/exiftool_files/lib/Test/Builder/TodoDiag.pm +68 -0
- package/bin/exiftool_files/lib/Test/Builder.pm +2653 -0
- package/bin/exiftool_files/lib/Test/Harness.pm +618 -0
- package/bin/exiftool_files/lib/Test/More.pm +1997 -0
- package/bin/exiftool_files/lib/Test/Simple.pm +220 -0
- package/bin/exiftool_files/lib/Test/Tester/Capture.pm +241 -0
- package/bin/exiftool_files/lib/Test/Tester/CaptureRunner.pm +79 -0
- package/bin/exiftool_files/lib/Test/Tester/Delegate.pm +45 -0
- package/bin/exiftool_files/lib/Test/Tester.pm +695 -0
- package/bin/exiftool_files/lib/Test/Tutorial.pod +618 -0
- package/bin/exiftool_files/lib/Test/use/ok.pm +64 -0
- package/bin/exiftool_files/lib/Text/ParseWords.pm +303 -0
- package/bin/exiftool_files/lib/Tie/StdHandle.pm +2 -2
- package/bin/exiftool_files/lib/Time/HiRes.pm +73 -68
- package/bin/exiftool_files/lib/Time/Local.pm +82 -35
- package/bin/exiftool_files/lib/Time/Piece.pm +19 -4
- package/bin/exiftool_files/lib/Time/Seconds.pm +1 -1
- package/bin/exiftool_files/lib/UNIVERSAL.pm +203 -0
- package/bin/exiftool_files/lib/Unicode/GCString.pm +60 -0
- package/bin/exiftool_files/lib/Unicode/LineBreak/Constants.pm +68 -0
- package/bin/exiftool_files/lib/Unicode/LineBreak.pm +248 -0
- package/bin/exiftool_files/lib/Win32/API/Struct.pm +1 -177
- package/bin/exiftool_files/lib/Win32/API/Type.pm +1 -100
- package/bin/exiftool_files/lib/Win32/API.pm +1 -830
- package/bin/exiftool_files/lib/Win32/FindFile.pm +2 -123
- package/bin/exiftool_files/lib/Win32.pm +213 -89
- package/bin/exiftool_files/lib/Win32API/File.pm +1 -1
- package/bin/exiftool_files/lib/auto/B/B.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Compress/Raw/Bzip2/Bzip2.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Compress/Raw/Lzma/Lzma.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Compress/Raw/Lzma/autosplit.ix +3 -0
- package/bin/exiftool_files/lib/auto/Compress/Raw/Zlib/Zlib.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/CryptX/CryptX.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Cwd/Cwd.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Data/Dumper/Dumper.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Digest/MD5/MD5.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Digest/SHA/SHA.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Encode/Encode.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Fcntl/Fcntl.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/File/Glob/Glob.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/IO/Compress/Brotli/Brotli.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/IO/IO.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/List/Util/Util.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/MIME/Base64/Base64.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Math/BigInt/FastCalc/FastCalc.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Math/BigInt/GMP/GMP.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/POSIX/POSIX.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/PerlIO/scalar/scalar.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Socket/Socket.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Storable/Storable.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Time/HiRes/HiRes.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Time/Piece/Piece.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Unicode/LineBreak/LineBreak.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Win32/API/API.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Win32/FindFile/FindFile.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Win32/Win32.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Win32API/File/File.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/mro/mro.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/re/re.xs.dll +0 -0
- package/bin/exiftool_files/lib/feature.pm +49 -17
- package/bin/exiftool_files/lib/mro.pm +4 -20
- package/bin/exiftool_files/lib/overload.pm +15 -15
- package/bin/exiftool_files/lib/parent.pm +10 -2
- package/bin/exiftool_files/lib/re.pm +91 -33
- package/bin/exiftool_files/lib/warnings.pm +17 -6
- package/bin/exiftool_files/libgcc_s_seh-1.dll +0 -0
- package/bin/exiftool_files/liblzma-5__.dll +0 -0
- package/bin/exiftool_files/libstdc++-6.dll +0 -0
- package/bin/exiftool_files/libwinpthread-1.dll +0 -0
- package/bin/exiftool_files/perl.exe +0 -0
- package/bin/exiftool_files/perl532.dll +0 -0
- package/package.json +6 -4
- package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/cs.pm +0 -978
- package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/de.pm +0 -1975
- package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/en_ca.pm +0 -44
- package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/en_gb.pm +0 -124
- package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/es.pm +0 -2921
- package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/fi.pm +0 -1116
- package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/fr.pm +0 -3171
- package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/it.pm +0 -2750
- package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/ja.pm +0 -10256
- package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/ko.pm +0 -4499
- package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/nl.pm +0 -1270
- package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/pl.pm +0 -3019
- package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/ru.pm +0 -18220
- package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/sk.pm +0 -441
- package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/sv.pm +0 -714
- package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/tr.pm +0 -452
- package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/zh_cn.pm +0 -2225
- package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/zh_tw.pm +0 -72
- package/bin/exiftool_files/libgcc_s_dw2-1.dll +0 -0
- package/bin/exiftool_files/perl530.dll +0 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
package Test::Simple;
|
|
2
|
+
|
|
3
|
+
use 5.006;
|
|
4
|
+
|
|
5
|
+
use strict;
|
|
6
|
+
|
|
7
|
+
our $VERSION = '1.302183';
|
|
8
|
+
|
|
9
|
+
use Test::Builder::Module;
|
|
10
|
+
our @ISA = qw(Test::Builder::Module);
|
|
11
|
+
our @EXPORT = qw(ok);
|
|
12
|
+
|
|
13
|
+
my $CLASS = __PACKAGE__;
|
|
14
|
+
|
|
15
|
+
=head1 NAME
|
|
16
|
+
|
|
17
|
+
Test::Simple - Basic utilities for writing tests.
|
|
18
|
+
|
|
19
|
+
=head1 SYNOPSIS
|
|
20
|
+
|
|
21
|
+
use Test::Simple tests => 1;
|
|
22
|
+
|
|
23
|
+
ok( $foo eq $bar, 'foo is bar' );
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
=head1 DESCRIPTION
|
|
27
|
+
|
|
28
|
+
** If you are unfamiliar with testing B<read L<Test::Tutorial> first!> **
|
|
29
|
+
|
|
30
|
+
This is an extremely simple, extremely basic module for writing tests
|
|
31
|
+
suitable for CPAN modules and other pursuits. If you wish to do more
|
|
32
|
+
complicated testing, use the Test::More module (a drop-in replacement
|
|
33
|
+
for this one).
|
|
34
|
+
|
|
35
|
+
The basic unit of Perl testing is the ok. For each thing you want to
|
|
36
|
+
test your program will print out an "ok" or "not ok" to indicate pass
|
|
37
|
+
or fail. You do this with the C<ok()> function (see below).
|
|
38
|
+
|
|
39
|
+
The only other constraint is you must pre-declare how many tests you
|
|
40
|
+
plan to run. This is in case something goes horribly wrong during the
|
|
41
|
+
test and your test program aborts, or skips a test or whatever. You
|
|
42
|
+
do this like so:
|
|
43
|
+
|
|
44
|
+
use Test::Simple tests => 23;
|
|
45
|
+
|
|
46
|
+
You must have a plan.
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
=over 4
|
|
50
|
+
|
|
51
|
+
=item B<ok>
|
|
52
|
+
|
|
53
|
+
ok( $foo eq $bar, $name );
|
|
54
|
+
ok( $foo eq $bar );
|
|
55
|
+
|
|
56
|
+
C<ok()> is given an expression (in this case C<$foo eq $bar>). If it's
|
|
57
|
+
true, the test passed. If it's false, it didn't. That's about it.
|
|
58
|
+
|
|
59
|
+
C<ok()> prints out either "ok" or "not ok" along with a test number (it
|
|
60
|
+
keeps track of that for you).
|
|
61
|
+
|
|
62
|
+
# This produces "ok 1 - Hell not yet frozen over" (or not ok)
|
|
63
|
+
ok( get_temperature($hell) > 0, 'Hell not yet frozen over' );
|
|
64
|
+
|
|
65
|
+
If you provide a $name, that will be printed along with the "ok/not
|
|
66
|
+
ok" to make it easier to find your test when if fails (just search for
|
|
67
|
+
the name). It also makes it easier for the next guy to understand
|
|
68
|
+
what your test is for. It's highly recommended you use test names.
|
|
69
|
+
|
|
70
|
+
All tests are run in scalar context. So this:
|
|
71
|
+
|
|
72
|
+
ok( @stuff, 'I have some stuff' );
|
|
73
|
+
|
|
74
|
+
will do what you mean (fail if stuff is empty)
|
|
75
|
+
|
|
76
|
+
=cut
|
|
77
|
+
|
|
78
|
+
sub ok ($;$) { ## no critic (Subroutines::ProhibitSubroutinePrototypes)
|
|
79
|
+
return $CLASS->builder->ok(@_);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
=back
|
|
83
|
+
|
|
84
|
+
Test::Simple will start by printing number of tests run in the form
|
|
85
|
+
"1..M" (so "1..5" means you're going to run 5 tests). This strange
|
|
86
|
+
format lets L<Test::Harness> know how many tests you plan on running in
|
|
87
|
+
case something goes horribly wrong.
|
|
88
|
+
|
|
89
|
+
If all your tests passed, Test::Simple will exit with zero (which is
|
|
90
|
+
normal). If anything failed it will exit with how many failed. If
|
|
91
|
+
you run less (or more) tests than you planned, the missing (or extras)
|
|
92
|
+
will be considered failures. If no tests were ever run Test::Simple
|
|
93
|
+
will throw a warning and exit with 255. If the test died, even after
|
|
94
|
+
having successfully completed all its tests, it will still be
|
|
95
|
+
considered a failure and will exit with 255.
|
|
96
|
+
|
|
97
|
+
So the exit codes are...
|
|
98
|
+
|
|
99
|
+
0 all tests successful
|
|
100
|
+
255 test died or all passed but wrong # of tests run
|
|
101
|
+
any other number how many failed (including missing or extras)
|
|
102
|
+
|
|
103
|
+
If you fail more than 254 tests, it will be reported as 254.
|
|
104
|
+
|
|
105
|
+
This module is by no means trying to be a complete testing system.
|
|
106
|
+
It's just to get you started. Once you're off the ground its
|
|
107
|
+
recommended you look at L<Test::More>.
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
=head1 EXAMPLE
|
|
111
|
+
|
|
112
|
+
Here's an example of a simple .t file for the fictional Film module.
|
|
113
|
+
|
|
114
|
+
use Test::Simple tests => 5;
|
|
115
|
+
|
|
116
|
+
use Film; # What you're testing.
|
|
117
|
+
|
|
118
|
+
my $btaste = Film->new({ Title => 'Bad Taste',
|
|
119
|
+
Director => 'Peter Jackson',
|
|
120
|
+
Rating => 'R',
|
|
121
|
+
NumExplodingSheep => 1
|
|
122
|
+
});
|
|
123
|
+
ok( defined($btaste) && ref $btaste eq 'Film', 'new() works' );
|
|
124
|
+
|
|
125
|
+
ok( $btaste->Title eq 'Bad Taste', 'Title() get' );
|
|
126
|
+
ok( $btaste->Director eq 'Peter Jackson', 'Director() get' );
|
|
127
|
+
ok( $btaste->Rating eq 'R', 'Rating() get' );
|
|
128
|
+
ok( $btaste->NumExplodingSheep == 1, 'NumExplodingSheep() get' );
|
|
129
|
+
|
|
130
|
+
It will produce output like this:
|
|
131
|
+
|
|
132
|
+
1..5
|
|
133
|
+
ok 1 - new() works
|
|
134
|
+
ok 2 - Title() get
|
|
135
|
+
ok 3 - Director() get
|
|
136
|
+
not ok 4 - Rating() get
|
|
137
|
+
# Failed test 'Rating() get'
|
|
138
|
+
# in t/film.t at line 14.
|
|
139
|
+
ok 5 - NumExplodingSheep() get
|
|
140
|
+
# Looks like you failed 1 tests of 5
|
|
141
|
+
|
|
142
|
+
Indicating the Film::Rating() method is broken.
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
=head1 CAVEATS
|
|
146
|
+
|
|
147
|
+
Test::Simple will only report a maximum of 254 failures in its exit
|
|
148
|
+
code. If this is a problem, you probably have a huge test script.
|
|
149
|
+
Split it into multiple files. (Otherwise blame the Unix folks for
|
|
150
|
+
using an unsigned short integer as the exit status).
|
|
151
|
+
|
|
152
|
+
Because VMS's exit codes are much, much different than the rest of the
|
|
153
|
+
universe, and perl does horrible mangling to them that gets in my way,
|
|
154
|
+
it works like this on VMS.
|
|
155
|
+
|
|
156
|
+
0 SS$_NORMAL all tests successful
|
|
157
|
+
4 SS$_ABORT something went wrong
|
|
158
|
+
|
|
159
|
+
Unfortunately, I can't differentiate any further.
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
=head1 NOTES
|
|
163
|
+
|
|
164
|
+
Test::Simple is B<explicitly> tested all the way back to perl 5.6.0.
|
|
165
|
+
|
|
166
|
+
Test::Simple is thread-safe in perl 5.8.1 and up.
|
|
167
|
+
|
|
168
|
+
=head1 HISTORY
|
|
169
|
+
|
|
170
|
+
This module was conceived while talking with Tony Bowden in his
|
|
171
|
+
kitchen one night about the problems I was having writing some really
|
|
172
|
+
complicated feature into the new Testing module. He observed that the
|
|
173
|
+
main problem is not dealing with these edge cases but that people hate
|
|
174
|
+
to write tests B<at all>. What was needed was a dead simple module
|
|
175
|
+
that took all the hard work out of testing and was really, really easy
|
|
176
|
+
to learn. Paul Johnson simultaneously had this idea (unfortunately,
|
|
177
|
+
he wasn't in Tony's kitchen). This is it.
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
=head1 SEE ALSO
|
|
181
|
+
|
|
182
|
+
=over 4
|
|
183
|
+
|
|
184
|
+
=item L<Test::More>
|
|
185
|
+
|
|
186
|
+
More testing functions! Once you outgrow Test::Simple, look at
|
|
187
|
+
L<Test::More>. Test::Simple is 100% forward compatible with L<Test::More>
|
|
188
|
+
(i.e. you can just use L<Test::More> instead of Test::Simple in your
|
|
189
|
+
programs and things will still work).
|
|
190
|
+
|
|
191
|
+
=back
|
|
192
|
+
|
|
193
|
+
Look in L<Test::More>'s SEE ALSO for more testing modules.
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
=head1 AUTHORS
|
|
197
|
+
|
|
198
|
+
Idea by Tony Bowden and Paul Johnson, code by Michael G Schwern
|
|
199
|
+
E<lt>schwern@pobox.comE<gt>, wardrobe by Calvin Klein.
|
|
200
|
+
|
|
201
|
+
=head1 MAINTAINERS
|
|
202
|
+
|
|
203
|
+
=over 4
|
|
204
|
+
|
|
205
|
+
=item Chad Granum E<lt>exodist@cpan.orgE<gt>
|
|
206
|
+
|
|
207
|
+
=back
|
|
208
|
+
|
|
209
|
+
=head1 COPYRIGHT
|
|
210
|
+
|
|
211
|
+
Copyright 2001-2008 by Michael G Schwern E<lt>schwern@pobox.comE<gt>.
|
|
212
|
+
|
|
213
|
+
This program is free software; you can redistribute it and/or
|
|
214
|
+
modify it under the same terms as Perl itself.
|
|
215
|
+
|
|
216
|
+
See F<http://www.perl.com/perl/misc/Artistic.html>
|
|
217
|
+
|
|
218
|
+
=cut
|
|
219
|
+
|
|
220
|
+
1;
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
use strict;
|
|
2
|
+
|
|
3
|
+
package Test::Tester::Capture;
|
|
4
|
+
|
|
5
|
+
our $VERSION = '1.302183';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
use Test::Builder;
|
|
9
|
+
|
|
10
|
+
use vars qw( @ISA );
|
|
11
|
+
@ISA = qw( Test::Builder );
|
|
12
|
+
|
|
13
|
+
# Make Test::Tester::Capture thread-safe for ithreads.
|
|
14
|
+
BEGIN {
|
|
15
|
+
use Config;
|
|
16
|
+
*share = sub { 0 };
|
|
17
|
+
*lock = sub { 0 };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
my $Curr_Test = 0; share($Curr_Test);
|
|
21
|
+
my @Test_Results = (); share(@Test_Results);
|
|
22
|
+
my $Prem_Diag = {diag => ""}; share($Curr_Test);
|
|
23
|
+
|
|
24
|
+
sub new
|
|
25
|
+
{
|
|
26
|
+
# Test::Tester::Capgture::new used to just return __PACKAGE__
|
|
27
|
+
# because Test::Builder::new enforced its singleton nature by
|
|
28
|
+
# return __PACKAGE__. That has since changed, Test::Builder::new now
|
|
29
|
+
# returns a blessed has and around version 0.78, Test::Builder::todo
|
|
30
|
+
# started wanting to modify $self. To cope with this, we now return
|
|
31
|
+
# a blessed hash. This is a short-term hack, the correct thing to do
|
|
32
|
+
# is to detect which style of Test::Builder we're dealing with and
|
|
33
|
+
# act appropriately.
|
|
34
|
+
|
|
35
|
+
my $class = shift;
|
|
36
|
+
return bless {}, $class;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
sub ok {
|
|
40
|
+
my($self, $test, $name) = @_;
|
|
41
|
+
|
|
42
|
+
my $ctx = $self->ctx;
|
|
43
|
+
|
|
44
|
+
# $test might contain an object which we don't want to accidentally
|
|
45
|
+
# store, so we turn it into a boolean.
|
|
46
|
+
$test = $test ? 1 : 0;
|
|
47
|
+
|
|
48
|
+
lock $Curr_Test;
|
|
49
|
+
$Curr_Test++;
|
|
50
|
+
|
|
51
|
+
my($pack, $file, $line) = $self->caller;
|
|
52
|
+
|
|
53
|
+
my $todo = $self->todo();
|
|
54
|
+
|
|
55
|
+
my $result = {};
|
|
56
|
+
share($result);
|
|
57
|
+
|
|
58
|
+
unless( $test ) {
|
|
59
|
+
@$result{ 'ok', 'actual_ok' } = ( ( $todo ? 1 : 0 ), 0 );
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
@$result{ 'ok', 'actual_ok' } = ( 1, $test );
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if( defined $name ) {
|
|
66
|
+
$name =~ s|#|\\#|g; # # in a name can confuse Test::Harness.
|
|
67
|
+
$result->{name} = $name;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
$result->{name} = '';
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if( $todo ) {
|
|
74
|
+
my $what_todo = $todo;
|
|
75
|
+
$result->{reason} = $what_todo;
|
|
76
|
+
$result->{type} = 'todo';
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
$result->{reason} = '';
|
|
80
|
+
$result->{type} = '';
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
$Test_Results[$Curr_Test-1] = $result;
|
|
84
|
+
|
|
85
|
+
unless( $test ) {
|
|
86
|
+
my $msg = $todo ? "Failed (TODO)" : "Failed";
|
|
87
|
+
$result->{fail_diag} = (" $msg test ($file at line $line)\n");
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
$result->{diag} = "";
|
|
91
|
+
$result->{_level} = $Test::Builder::Level;
|
|
92
|
+
$result->{_depth} = Test::Tester::find_run_tests();
|
|
93
|
+
|
|
94
|
+
$ctx->release;
|
|
95
|
+
|
|
96
|
+
return $test ? 1 : 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
sub skip {
|
|
100
|
+
my($self, $why) = @_;
|
|
101
|
+
$why ||= '';
|
|
102
|
+
|
|
103
|
+
my $ctx = $self->ctx;
|
|
104
|
+
|
|
105
|
+
lock($Curr_Test);
|
|
106
|
+
$Curr_Test++;
|
|
107
|
+
|
|
108
|
+
my %result;
|
|
109
|
+
share(%result);
|
|
110
|
+
%result = (
|
|
111
|
+
'ok' => 1,
|
|
112
|
+
actual_ok => 1,
|
|
113
|
+
name => '',
|
|
114
|
+
type => 'skip',
|
|
115
|
+
reason => $why,
|
|
116
|
+
diag => "",
|
|
117
|
+
_level => $Test::Builder::Level,
|
|
118
|
+
_depth => Test::Tester::find_run_tests(),
|
|
119
|
+
);
|
|
120
|
+
$Test_Results[$Curr_Test-1] = \%result;
|
|
121
|
+
|
|
122
|
+
$ctx->release;
|
|
123
|
+
return 1;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
sub todo_skip {
|
|
127
|
+
my($self, $why) = @_;
|
|
128
|
+
$why ||= '';
|
|
129
|
+
|
|
130
|
+
my $ctx = $self->ctx;
|
|
131
|
+
|
|
132
|
+
lock($Curr_Test);
|
|
133
|
+
$Curr_Test++;
|
|
134
|
+
|
|
135
|
+
my %result;
|
|
136
|
+
share(%result);
|
|
137
|
+
%result = (
|
|
138
|
+
'ok' => 1,
|
|
139
|
+
actual_ok => 0,
|
|
140
|
+
name => '',
|
|
141
|
+
type => 'todo_skip',
|
|
142
|
+
reason => $why,
|
|
143
|
+
diag => "",
|
|
144
|
+
_level => $Test::Builder::Level,
|
|
145
|
+
_depth => Test::Tester::find_run_tests(),
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
$Test_Results[$Curr_Test-1] = \%result;
|
|
149
|
+
|
|
150
|
+
$ctx->release;
|
|
151
|
+
return 1;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
sub diag {
|
|
155
|
+
my($self, @msgs) = @_;
|
|
156
|
+
return unless @msgs;
|
|
157
|
+
|
|
158
|
+
# Prevent printing headers when compiling (i.e. -c)
|
|
159
|
+
return if $^C;
|
|
160
|
+
|
|
161
|
+
my $ctx = $self->ctx;
|
|
162
|
+
|
|
163
|
+
# Escape each line with a #.
|
|
164
|
+
foreach (@msgs) {
|
|
165
|
+
$_ = 'undef' unless defined;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
push @msgs, "\n" unless $msgs[-1] =~ /\n\Z/;
|
|
169
|
+
|
|
170
|
+
my $result = $Curr_Test ? $Test_Results[$Curr_Test - 1] : $Prem_Diag;
|
|
171
|
+
|
|
172
|
+
$result->{diag} .= join("", @msgs);
|
|
173
|
+
|
|
174
|
+
$ctx->release;
|
|
175
|
+
return 0;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
sub details {
|
|
179
|
+
return @Test_Results;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
# Stub. Feel free to send me a patch to implement this.
|
|
184
|
+
sub note {
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
sub explain {
|
|
188
|
+
return Test::Builder::explain(@_);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
sub premature
|
|
192
|
+
{
|
|
193
|
+
return $Prem_Diag->{diag};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
sub current_test
|
|
197
|
+
{
|
|
198
|
+
if (@_ > 1)
|
|
199
|
+
{
|
|
200
|
+
die "Don't try to change the test number!";
|
|
201
|
+
}
|
|
202
|
+
else
|
|
203
|
+
{
|
|
204
|
+
return $Curr_Test;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
sub reset
|
|
209
|
+
{
|
|
210
|
+
$Curr_Test = 0;
|
|
211
|
+
@Test_Results = ();
|
|
212
|
+
$Prem_Diag = {diag => ""};
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
1;
|
|
216
|
+
|
|
217
|
+
__END__
|
|
218
|
+
|
|
219
|
+
=head1 NAME
|
|
220
|
+
|
|
221
|
+
Test::Tester::Capture - Help testing test modules built with Test::Builder
|
|
222
|
+
|
|
223
|
+
=head1 DESCRIPTION
|
|
224
|
+
|
|
225
|
+
This is a subclass of Test::Builder that overrides many of the methods so
|
|
226
|
+
that they don't output anything. It also keeps track of its own set of test
|
|
227
|
+
results so that you can use Test::Builder based modules to perform tests on
|
|
228
|
+
other Test::Builder based modules.
|
|
229
|
+
|
|
230
|
+
=head1 AUTHOR
|
|
231
|
+
|
|
232
|
+
Most of the code here was lifted straight from Test::Builder and then had
|
|
233
|
+
chunks removed by Fergal Daly <fergal@esatclear.ie>.
|
|
234
|
+
|
|
235
|
+
=head1 LICENSE
|
|
236
|
+
|
|
237
|
+
Under the same license as Perl itself
|
|
238
|
+
|
|
239
|
+
See http://www.perl.com/perl/misc/Artistic.html
|
|
240
|
+
|
|
241
|
+
=cut
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# $Header: /home/fergal/my/cvs/Test-Tester/lib/Test/Tester/CaptureRunner.pm,v 1.3 2003/03/05 01:07:55 fergal Exp $
|
|
2
|
+
use strict;
|
|
3
|
+
|
|
4
|
+
package Test::Tester::CaptureRunner;
|
|
5
|
+
|
|
6
|
+
our $VERSION = '1.302183';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
use Test::Tester::Capture;
|
|
10
|
+
require Exporter;
|
|
11
|
+
|
|
12
|
+
sub new
|
|
13
|
+
{
|
|
14
|
+
my $pkg = shift;
|
|
15
|
+
my $self = bless {}, $pkg;
|
|
16
|
+
return $self;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
sub run_tests
|
|
20
|
+
{
|
|
21
|
+
my $self = shift;
|
|
22
|
+
|
|
23
|
+
my $test = shift;
|
|
24
|
+
|
|
25
|
+
capture()->reset;
|
|
26
|
+
|
|
27
|
+
$self->{StartLevel} = $Test::Builder::Level;
|
|
28
|
+
&$test();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
sub get_results
|
|
32
|
+
{
|
|
33
|
+
my $self = shift;
|
|
34
|
+
my @results = capture()->details;
|
|
35
|
+
|
|
36
|
+
my $start = $self->{StartLevel};
|
|
37
|
+
foreach my $res (@results)
|
|
38
|
+
{
|
|
39
|
+
next if defined $res->{depth};
|
|
40
|
+
my $depth = $res->{_depth} - $res->{_level} - $start - 3;
|
|
41
|
+
# print "my $depth = $res->{_depth} - $res->{_level} - $start - 1\n";
|
|
42
|
+
$res->{depth} = $depth;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return @results;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
sub get_premature
|
|
49
|
+
{
|
|
50
|
+
return capture()->premature;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
sub capture
|
|
54
|
+
{
|
|
55
|
+
return Test::Tester::Capture->new;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
__END__
|
|
59
|
+
|
|
60
|
+
=head1 NAME
|
|
61
|
+
|
|
62
|
+
Test::Tester::CaptureRunner - Help testing test modules built with Test::Builder
|
|
63
|
+
|
|
64
|
+
=head1 DESCRIPTION
|
|
65
|
+
|
|
66
|
+
This stuff if needed to allow me to play with other ways of monitoring the
|
|
67
|
+
test results.
|
|
68
|
+
|
|
69
|
+
=head1 AUTHOR
|
|
70
|
+
|
|
71
|
+
Copyright 2003 by Fergal Daly <fergal@esatclear.ie>.
|
|
72
|
+
|
|
73
|
+
=head1 LICENSE
|
|
74
|
+
|
|
75
|
+
Under the same license as Perl itself
|
|
76
|
+
|
|
77
|
+
See http://www.perl.com/perl/misc/Artistic.html
|
|
78
|
+
|
|
79
|
+
=cut
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
use strict;
|
|
2
|
+
use warnings;
|
|
3
|
+
|
|
4
|
+
package Test::Tester::Delegate;
|
|
5
|
+
|
|
6
|
+
our $VERSION = '1.302183';
|
|
7
|
+
|
|
8
|
+
use Scalar::Util();
|
|
9
|
+
|
|
10
|
+
use vars '$AUTOLOAD';
|
|
11
|
+
|
|
12
|
+
sub new
|
|
13
|
+
{
|
|
14
|
+
my $pkg = shift;
|
|
15
|
+
|
|
16
|
+
my $obj = shift;
|
|
17
|
+
my $self = bless {}, $pkg;
|
|
18
|
+
|
|
19
|
+
return $self;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
sub AUTOLOAD
|
|
23
|
+
{
|
|
24
|
+
my ($sub) = $AUTOLOAD =~ /.*::(.*?)$/;
|
|
25
|
+
|
|
26
|
+
return if $sub eq "DESTROY";
|
|
27
|
+
|
|
28
|
+
my $obj = $_[0]->{Object};
|
|
29
|
+
|
|
30
|
+
my $ref = $obj->can($sub);
|
|
31
|
+
shift(@_);
|
|
32
|
+
unshift(@_, $obj);
|
|
33
|
+
goto &$ref;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
sub can {
|
|
37
|
+
my $this = shift;
|
|
38
|
+
my ($sub) = @_;
|
|
39
|
+
|
|
40
|
+
return $this->{Object}->can($sub) if Scalar::Util::blessed($this);
|
|
41
|
+
|
|
42
|
+
return $this->SUPER::can(@_);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
1;
|