├── .gitignore ├── README.md ├── cpan └── prefs │ ├── AnyEvent-Fork-Pool.yml │ ├── AnyEvent-Fork.yml │ ├── Async-Interrupt.yml │ ├── Digest-MD6.yml │ ├── EV.yml │ ├── Feersum.yml │ ├── IO-AIO.yml │ ├── LMDB_File.yml │ ├── Math-BigInt-GMP.yml │ ├── Net-SNMP.yml │ ├── README.md │ └── version.yml ├── doc ├── AnyEvent-Fork-Pool │ └── 01-patches.txt ├── AnyEvent-MP │ └── 01_install.txt ├── App-Context │ └── 01-fix_cgi_bin_path.txt ├── CHI │ └── 01-install.txt ├── Convert-ASN1 │ └── 01-staticperl-build-note.txt ├── MongoDB-Async │ └── 01-install.txt ├── Net-SNMP │ └── 01_install.txt ├── Term-ReadLine-Gnu │ └── 01-undefined-symbol-xmalloc.txt ├── XML-Compile-SOAP │ └── 01-install.txt └── XML-LibXML │ └── 01_install.txt ├── misc ├── auto-install.sh ├── backup-staticperl.sh ├── solaris │ └── staticperlrc-stableperl ├── stablestaticperl.diff ├── staticperl-path.sh ├── staticperlrc └── staticperlrc-stableperl ├── modules ├── Config-Augeas-1.000 │ ├── Augeas.xs │ ├── ChangeLog │ ├── MANIFEST │ ├── MANIFEST.SKIP │ ├── META.json │ ├── META.yml │ ├── Makefile.PL │ ├── README │ ├── augeas-box │ │ └── etc │ │ │ ├── hosts │ │ │ └── ssh │ │ │ ├── ssh_config │ │ │ └── sshd_config │ ├── lib │ │ └── Config │ │ │ └── Augeas.pm │ ├── ppport.h │ ├── t │ │ ├── Config-Augeas.t │ │ ├── Config-AugeasC.t │ │ └── pod.t │ └── typemap ├── HTML-Escape-1.10 │ ├── Changes │ ├── Escape.xs │ ├── LICENSE │ ├── MANIFEST │ ├── META.json │ ├── META.yml │ ├── Makefile.PL │ ├── README.md │ ├── author │ │ └── benchmark.pl │ ├── lib │ │ └── HTML │ │ │ ├── Escape.pm │ │ │ └── Escape │ │ │ └── PurePerl.pm │ ├── ppport.h │ ├── t │ │ ├── 00_compile.t │ │ ├── 01_simple.t │ │ └── 02_pp.t │ └── xt │ │ └── 02_perlcritic.t ├── Lexical-SealRequireHints-0.010 │ ├── Changes │ ├── MANIFEST │ ├── META.json │ ├── META.yml │ ├── Makefile.PL │ ├── README │ ├── SIGNATURE │ ├── SealRequireHints.xs │ ├── lib │ │ └── Lexical │ │ │ └── SealRequireHints.pm │ └── t │ │ ├── before_warnings.t │ │ ├── before_warnings_pp.t │ │ ├── context.t │ │ ├── context_0.pm │ │ ├── context_1.pm │ │ ├── context_2.pm │ │ ├── context_pp.t │ │ ├── defsv.t │ │ ├── eval.t │ │ ├── eval_0.pm │ │ ├── eval_pp.t │ │ ├── idempotent.t │ │ ├── idempotent_pp.t │ │ ├── override.t │ │ ├── override_pp.t │ │ ├── package.t │ │ ├── package_0.pm │ │ ├── package_pp.t │ │ ├── pod_cvg.t │ │ ├── pod_cvg_pp.t │ │ ├── pod_syn.t │ │ ├── seal.t │ │ ├── seal_0.pm │ │ ├── seal_1.pm │ │ ├── seal_2.pm │ │ ├── seal_3.pm │ │ ├── seal_4.pm │ │ ├── seal_pp.t │ │ ├── setup_pp.pl │ │ ├── swash.t │ │ ├── swash_pp.t │ │ ├── threads.t │ │ ├── threads_pp.t │ │ ├── version_check.t │ │ ├── version_check_pp.t │ │ ├── version_feature.t │ │ └── version_feature_pp.t ├── Params-Classify-0.013 │ ├── Changes │ ├── Classify.xs │ ├── MANIFEST │ ├── META.yml │ ├── Makefile.PL │ ├── README │ ├── SIGNATURE │ ├── lib │ │ └── Params │ │ │ └── Classify.pm │ └── t │ │ ├── blessed.t │ │ ├── blessed_pp.t │ │ ├── check.t │ │ ├── check_pp.t │ │ ├── classify.t │ │ ├── classify_pp.t │ │ ├── error.t │ │ ├── error_pp.t │ │ ├── pod_cvg.t │ │ ├── pod_cvg_pp.t │ │ ├── pod_syn.t │ │ ├── ref.t │ │ ├── ref_pp.t │ │ └── setup_pp.pl ├── Params-Validate-1.23 │ ├── CONTRIBUTING.md │ ├── Changes │ ├── INSTALL │ ├── LICENSE │ ├── MANIFEST │ ├── META.json │ ├── META.yml │ ├── Makefile.PL │ ├── README.md │ ├── TODO │ ├── benchmarks │ │ └── basic │ ├── lib │ │ └── Params │ │ │ ├── Validate.pm │ │ │ ├── Validate │ │ │ ├── Constants.pm │ │ │ ├── PP.pm │ │ │ └── XS.pm │ │ │ ├── ValidatePP.pm │ │ │ └── ValidateXS.pm │ ├── t │ │ ├── 00-report-prereqs.dd │ │ ├── 00-report-prereqs.t │ │ ├── 01-validate.t │ │ ├── 02-noop.t │ │ ├── 04-defaults.t │ │ ├── 05-noop_default.t │ │ ├── 06-options.t │ │ ├── 07-with.t │ │ ├── 08-noop_with.t │ │ ├── 09-regex.t │ │ ├── 10-noop_regex.t │ │ ├── 11-cb.t │ │ ├── 12-noop_cb.t │ │ ├── 13-taint.t │ │ ├── 14-no_validate.t │ │ ├── 15-case.t │ │ ├── 16-normalize.t │ │ ├── 17-callbacks.t │ │ ├── 18-depends.t │ │ ├── 19-untaint.t │ │ ├── 21-can.t │ │ ├── 22-overload-can-bug.t │ │ ├── 23-readonly.t │ │ ├── 24-tied.t │ │ ├── 25-undef-regex.t │ │ ├── 26-isa.t │ │ ├── 27-string-as-type.t │ │ ├── 28-readonly-return.t │ │ ├── 29-taint-mode.t │ │ ├── 30-hashref-alteration.t │ │ ├── 31-incorrect-spelling.t │ │ ├── 32-regex-as-value.t │ │ ├── 33-keep-errsv.t │ │ ├── 34-recursive-validation.t │ │ ├── 35-default-xs-bug.t │ │ ├── 36-large-arrays.t │ │ ├── 37-exports.t │ │ ├── 38-callback-message.t │ │ ├── 39-reentrant.t │ │ ├── author-00-compile.t │ │ ├── author-eol.t │ │ ├── author-memory-leak.t │ │ ├── author-mojibake.t │ │ ├── author-no-tabs.t │ │ ├── author-pod-spell.t │ │ ├── author-pod-syntax.t │ │ ├── author-pp-01-validate.t │ │ ├── author-pp-02-noop.t │ │ ├── author-pp-04-defaults.t │ │ ├── author-pp-05-noop_default.t │ │ ├── author-pp-06-options.t │ │ ├── author-pp-07-with.t │ │ ├── author-pp-08-noop_with.t │ │ ├── author-pp-09-regex.t │ │ ├── author-pp-10-noop_regex.t │ │ ├── author-pp-11-cb.t │ │ ├── author-pp-12-noop_cb.t │ │ ├── author-pp-13-taint.t │ │ ├── author-pp-14-no_validate.t │ │ ├── author-pp-15-case.t │ │ ├── author-pp-16-normalize.t │ │ ├── author-pp-17-callbacks.t │ │ ├── author-pp-18-depends.t │ │ ├── author-pp-19-untaint.t │ │ ├── author-pp-21-can.t │ │ ├── author-pp-22-overload-can-bug.t │ │ ├── author-pp-23-readonly.t │ │ ├── author-pp-24-tied.t │ │ ├── author-pp-25-undef-regex.t │ │ ├── author-pp-26-isa.t │ │ ├── author-pp-27-string-as-type.t │ │ ├── author-pp-28-readonly-return.t │ │ ├── author-pp-29-taint-mode.t │ │ ├── author-pp-30-hashref-alteration.t │ │ ├── author-pp-31-incorrect-spelling.t │ │ ├── author-pp-32-regex-as-value.t │ │ ├── author-pp-33-keep-errsv.t │ │ ├── author-pp-34-recursive-validation.t │ │ ├── author-pp-35-default-xs-bug.t │ │ ├── author-pp-36-large-arrays.t │ │ ├── author-pp-37-exports.t │ │ ├── author-pp-38-callback-message.t │ │ ├── author-pp-39-reentrant.t │ │ ├── author-pp-is-loaded.t │ │ ├── author-xs-is-loaded.t │ │ ├── author-xs-segfault.t │ │ ├── author-xs-stack-realloc.t │ │ ├── lib │ │ │ ├── PVTests.pm │ │ │ └── PVTests │ │ │ │ ├── Callbacks.pm │ │ │ │ ├── Defaults.pm │ │ │ │ ├── Regex.pm │ │ │ │ ├── Standard.pm │ │ │ │ └── With.pm │ │ ├── release-cpan-changes.t │ │ ├── release-meta-json.t │ │ ├── release-pod-coverage.t │ │ ├── release-pod-linkcheck.t │ │ ├── release-pod-no404s.t │ │ ├── release-portability.t │ │ └── release-synopsis.t │ └── xs │ │ ├── Makefile.PL │ │ ├── XS.xs │ │ └── ppport.h ├── RRD-Tweak-1.00 │ ├── Changes │ ├── DEBUGGING │ ├── MANIFEST │ ├── META.yml │ ├── Makefile.PL │ ├── README │ ├── Tweak.xs │ ├── cmds.gdb │ ├── lib │ │ └── RRD │ │ │ └── Tweak.pm │ └── t │ │ ├── 00-load.t │ │ ├── 05-manifest.t │ │ ├── 05-pod-coverage.t │ │ ├── 05-pod.t │ │ ├── 10-create_rrd.t │ │ ├── 20-leaktrace.skip │ │ ├── 20-load_save_rrd.t │ │ ├── 30-add_del_ds_rra.t │ │ ├── 30-add_rra.t │ │ ├── 30-del_rra_holtwinters.t │ │ ├── 30-modify_ds.t │ │ └── 30-modify_rra.t ├── Text-Markdown-Hoedown-1.01 │ ├── Changes │ ├── Hoedown.xs │ ├── LICENSE │ ├── MANIFEST │ ├── META.json │ ├── META.yml │ ├── Makefile.PL │ ├── README │ ├── README.md │ ├── author │ │ ├── benchmark.pl │ │ ├── generate.pl │ │ └── tmpl │ │ │ └── Callbacks.pod │ ├── gen.callback.c │ ├── gen.callback.inc │ ├── hoedown │ │ ├── LICENSE │ │ ├── Makefile.PL │ │ ├── README.md │ │ ├── autolink.c │ │ ├── autolink.h │ │ ├── buffer.c │ │ ├── buffer.h │ │ ├── escape.c │ │ ├── escape.h │ │ ├── hoedown.c │ │ ├── html.c │ │ ├── html.h │ │ ├── html_block_names.gperf │ │ ├── html_blocks.c │ │ ├── html_smartypants.c │ │ ├── markdown.c │ │ ├── markdown.h │ │ ├── smartypants.c │ │ ├── stack.c │ │ ├── stack.h │ │ └── test │ │ │ └── MarkdownTest_1.0.3 │ │ │ ├── MarkdownTest.pl │ │ │ └── Tests │ │ │ ├── Amps and angle encoding.html │ │ │ ├── Amps and angle encoding.text │ │ │ ├── Auto links.html │ │ │ ├── Auto links.text │ │ │ ├── Backslash escapes.html │ │ │ ├── Backslash escapes.text │ │ │ ├── Blockquotes with code blocks.html │ │ │ ├── Blockquotes with code blocks.text │ │ │ ├── Code Blocks.html │ │ │ ├── Code Blocks.text │ │ │ ├── Code Spans.html │ │ │ ├── Code Spans.text │ │ │ ├── Hard-wrapped paragraphs with list-like lines.html │ │ │ ├── Hard-wrapped paragraphs with list-like lines.text │ │ │ ├── Horizontal rules.html │ │ │ ├── Horizontal rules.text │ │ │ ├── Inline HTML (Advanced).html │ │ │ ├── Inline HTML (Advanced).text │ │ │ ├── Inline HTML (Simple).html │ │ │ ├── Inline HTML (Simple).text │ │ │ ├── Inline HTML comments.html │ │ │ ├── Inline HTML comments.text │ │ │ ├── Links, inline style.html │ │ │ ├── Links, inline style.text │ │ │ ├── Links, reference style.html │ │ │ ├── Links, reference style.text │ │ │ ├── Links, shortcut references.html │ │ │ ├── Links, shortcut references.text │ │ │ ├── Literal quotes in titles.html │ │ │ ├── Literal quotes in titles.text │ │ │ ├── Markdown Documentation - Basics.html │ │ │ ├── Markdown Documentation - Basics.text │ │ │ ├── Markdown Documentation - Syntax.html │ │ │ ├── Markdown Documentation - Syntax.text │ │ │ ├── Nested blockquotes.html │ │ │ ├── Nested blockquotes.text │ │ │ ├── Ordered and unordered lists.html │ │ │ ├── Ordered and unordered lists.text │ │ │ ├── Strong and em together.html │ │ │ ├── Strong and em together.text │ │ │ ├── Tabs.html │ │ │ ├── Tabs.text │ │ │ ├── Tidyness.html │ │ │ └── Tidyness.text │ ├── lib │ │ └── Text │ │ │ └── Markdown │ │ │ ├── Hoedown.pm │ │ │ └── Hoedown │ │ │ ├── Callbacks.pod │ │ │ └── Markdown.pod │ ├── ppport.h │ └── t │ │ ├── 00_compile.t │ │ ├── 01_simple.t │ │ ├── 02_toc.t │ │ └── 03_custom.t └── UnQLite-0.05 │ ├── Changes │ ├── LICENSE │ ├── MANIFEST │ ├── META.json │ ├── META.yml │ ├── Makefile.PL │ ├── README │ ├── README.md │ ├── UnQLite.xs │ ├── cpanfile │ ├── lib │ └── UnQLite.pm │ ├── ppport.h │ ├── t │ ├── 00_compile.t │ ├── 01_simple.t │ ├── 02_cursor.t │ └── 03_tie.t │ └── unqlite │ ├── Makefile.PL │ ├── license.txt │ ├── unqlite.c │ └── unqlite.h ├── patches ├── AnyEvent-Fork-Pool │ └── 0001-Pool.diff ├── AnyEvent-Fork │ └── rt100561.diff ├── Async-Interrupt │ └── 0001-schmorp.h-Win32.diff ├── Digest-MD6 │ ├── 0001-inc-Devel-CheckLib.pm.diff │ └── 0002-kat_mct.t.diff ├── Feersum │ └── 0001-13-pre-fork.t.diff ├── Filter-Util-Call │ └── 0001-Makefile.PL.diff ├── IO-AIO │ └── 0001-AIO.xs.diff ├── IO-Tty │ └── 0001-Makefile.PL.diff ├── LMDB_File │ └── 0001-Makefile.PL.diff ├── Math-BigInt-GMP │ └── 0001-bigfltpm.inc.patch ├── Unicode-LineBreak │ └── 0001-Makefile.PL.diff ├── old │ └── Net-SNMP-XS │ │ └── Net-SNMP-XS_01.diff ├── staticperl │ └── dollar_zero_crash_fix.diff └── todo │ └── Proc-FastSpawn │ └── Proc-FastSpawn-dup_stdin_stdout.diff └── staticperl /.gitignore: -------------------------------------------------------------------------------- 1 | misc/staticperlrc.my 2 | modules/*.orig 3 | modules/*.tar.gz 4 | *~ -------------------------------------------------------------------------------- /cpan/prefs/AnyEvent-Fork-Pool.yml: -------------------------------------------------------------------------------- 1 | comment: | 2 | 3 | AnyEvent::Fork::Pool, version 1.2 4 | Alternative way to count ncpu 5 | 6 | match: 7 | distribution: "^MLEHMANN/AnyEvent-Fork-Pool-1.2." 8 | 9 | patches: 10 | - "AnyEvent-Fork-Pool/0001-Pool.diff" 11 | -------------------------------------------------------------------------------- /cpan/prefs/AnyEvent-Fork.yml: -------------------------------------------------------------------------------- 1 | comment: | 2 | 3 | AnyEvent::Fork, version 1.2 4 | Bugfix of RT #100561 5 | 6 | match: 7 | distribution: "^MLEHMANN/AnyEvent-Fork-1.2." 8 | 9 | patches: 10 | - "AnyEvent-Fork/rt100561.diff" 11 | -------------------------------------------------------------------------------- /cpan/prefs/Async-Interrupt.yml: -------------------------------------------------------------------------------- 1 | comment: | 2 | 3 | Async-Interrupt, version 1.21 4 | * Fix issue in schmorp.h for Strawberry Perl on Win32 5 | 6 | match: 7 | distribution: "^MLEHMANN/Async-Interrupt-1.2" 8 | 9 | patches: 10 | - "Async-Interrupt/0001-schmorp.h-Win32.diff" 11 | -------------------------------------------------------------------------------- /cpan/prefs/Digest-MD6.yml: -------------------------------------------------------------------------------- 1 | comment: | 2 | 3 | Digest::MD6, version 0.11 4 | * Fix issue for modern perl in inc/Devel/CheckLib.pm 5 | * Fix test t/kat_mct.t when LWP::Simple is not installed 6 | 7 | match: 8 | distribution: "^ANDYA/Digest-MD6-0.11" 9 | 10 | patches: 11 | - "Digest-MD6/0001-inc-Devel-CheckLib.pm.diff" 12 | - "Digest-MD6/0002-kat_mct.t.diff" 13 | -------------------------------------------------------------------------------- /cpan/prefs/EV.yml: -------------------------------------------------------------------------------- 1 | comment: | 2 | 3 | EV on Alpine Linux 3.xx must be compiled with -DEV_NO_ATFORK 4 | Usage\: export ATFORK=1 5 | 6 | match: 7 | distribution: "^MLEHMANN/EV-4." 8 | perlconfig: 9 | osname: "linux" 10 | env: 11 | ATFORK: "NO" 12 | 13 | pl: 14 | args: 15 | - "DEFINE=-DEV_NO_ATFORK" 16 | -------------------------------------------------------------------------------- /cpan/prefs/Feersum.yml: -------------------------------------------------------------------------------- 1 | comment: | 2 | 3 | Feersum 1.403 4 | Patch for t/13-pre-fork.t: 5 | * Add sleep(2) for slow devices. 6 | 7 | match: 8 | distribution: "^AUDREYT/Feersum-1.403" 9 | 10 | patches: 11 | - "Feersum/0001-13-pre-fork.t.diff" 12 | -------------------------------------------------------------------------------- /cpan/prefs/IO-AIO.yml: -------------------------------------------------------------------------------- 1 | comment: | 2 | 3 | IO::AIO, version 4.32 4 | Patches for Solaris 10 (x86) 5 | 6 | match: 7 | distribution: "^MLEHMANN/IO-AIO-4.32" 8 | perlconfig: 9 | osname: "solaris" 10 | 11 | patches: 12 | - "IO-AIO/0001-AIO.xs.diff" 13 | -------------------------------------------------------------------------------- /cpan/prefs/LMDB_File.yml: -------------------------------------------------------------------------------- 1 | comment: | 2 | 3 | LMBD_File, version 0.07[_4] 4 | Allow builds on x86 5 | 6 | match: 7 | distribution: "^SORTIZ/LMDB_File-0.07" 8 | patches: 9 | - "LMDB_File/0001-Makefile.PL.diff" 10 | -------------------------------------------------------------------------------- /cpan/prefs/Math-BigInt-GMP.yml: -------------------------------------------------------------------------------- 1 | comment: | 2 | 3 | Math::BigInt::GMP, version 1.38 4 | Apply patch: https://rt.cpan.org/Public/Ticket/Attachment/1481298/789116 5 | RT: https://rt.cpan.org/Public/Bug/Display.html?id=96113 6 | 7 | match: 8 | distribution: "^PJACKLAM/Math-BigInt-GMP-1.38" 9 | patches: 10 | - "Math-BigInt-GMP/0001-bigfltpm.inc.patch" 11 | -------------------------------------------------------------------------------- /cpan/prefs/Net-SNMP.yml: -------------------------------------------------------------------------------- 1 | comment: | 2 | 3 | Install additional modules for Net::SNMP 4 | to use SNMPv3 out of a box 5 | 6 | match: 7 | distribution: "^DTOWN/Net-SNMP-" 8 | 9 | depends: 10 | requires: 11 | Crypt::DES: 0 12 | Digest::MD5: 0 13 | Digest::SHA1: 0 14 | Digest::HMAC: 0 15 | Crypt::Rijndael: 0 16 | -------------------------------------------------------------------------------- /cpan/prefs/README.md: -------------------------------------------------------------------------------- 1 | # CPAN distroprefs 2 | 3 | Tested with next settings of [CPAN][1], version 2.11 (perl 5.22.0): 4 | 5 | * patch: /usr/bin/patch 6 | * yaml_module: YAML::XS 7 | * prefs_dir: /path/to/staticperl-modules/cpan/prefs 8 | * patches_dir: /path/to/staticperl-modules/patches 9 | 10 | [1]: http://search.cpan.org/perldoc?CPAN 11 | -------------------------------------------------------------------------------- /cpan/prefs/version.yml: -------------------------------------------------------------------------------- 1 | comment: | 2 | 3 | version.pm 4 | Build XS version on update 5 | 6 | match: 7 | distribution: "^JPEACOCK/version-" 8 | 9 | pl: 10 | args: 11 | - "--xs" 12 | -------------------------------------------------------------------------------- /doc/AnyEvent-Fork-Pool/01-patches.txt: -------------------------------------------------------------------------------- 1 | File: patches/AnyEvent-Fork-Pool/0001-Pool.diff 2 | 3 | * another implementation for caclulating cpus, ncpus (optional patch) 4 | -------------------------------------------------------------------------------- /doc/AnyEvent-MP/01_install.txt: -------------------------------------------------------------------------------- 1 | ==> sick by Digest::MD6 2 | 3 | install LWP::Simple Net::Interface 4 | install Digest::HMAC Crypt::DES Digest::SHA1 5 | install Object::Accessor 6 | install Digest::MD6 Digest::HMAC_MD6 7 | 8 | install AnyEvent::MP 9 | -------------------------------------------------------------------------------- /doc/App-Context/01-fix_cgi_bin_path.txt: -------------------------------------------------------------------------------- 1 | mkdir $STATICPERL/perl/cgi-bin 2 | -------------------------------------------------------------------------------- /doc/CHI/01-install.txt: -------------------------------------------------------------------------------- 1 | install Moose UUID Test::Exception Test::Class 2 | install Test::Output Date::Parse 3 | install Test::Pod Test::Pod::Coverage Test::Tester 4 | install Test::NoWarnings Test::Deep 5 | install Test::Requires Module::Runtime Test::Warn 6 | 7 | install CHI 8 | -------------------------------------------------------------------------------- /doc/Convert-ASN1/01-staticperl-build-note.txt: -------------------------------------------------------------------------------- 1 | Do NOT use --strip ppi option. -------------------------------------------------------------------------------- /doc/MongoDB-Async/01-install.txt: -------------------------------------------------------------------------------- 1 | install DateTime boolean 2 | install Test::Exception Test::Deep 3 | install Test::LeakTrace Test::Requires 4 | install JSON::XS JSON 5 | install Tie::IxHash Data::Types Class::Method::Modifiers File::Slurp 6 | install Mouse MouseX::Types Any::Moose 7 | install DateTime::Tiny Module::Install Moose 8 | install Data::Dump 9 | 10 | install MongoDB::Async 11 | -------------------------------------------------------------------------------- /doc/Net-SNMP/01_install.txt: -------------------------------------------------------------------------------- 1 | install Crypt::DES Digest::MD5 Digest::SHA1 Digest::HMAC Crypt::Rijndael 2 | 3 | install Net::SNMP 4 | -------------------------------------------------------------------------------- /doc/Term-ReadLine-Gnu/01-undefined-symbol-xmalloc.txt: -------------------------------------------------------------------------------- 1 | URL: 2 | https://rt.cpan.org/Public/Bug/Display.html?id=65973 3 | 4 | o conf makepl_arg 'CCFLAGS=" -Dxrealloc=_rl_realloc -Dxmalloc=_rl_malloc -Dxfree=_rl_free "' 5 | 6 | -------------------------------------------------------------------------------- /doc/XML-Compile-SOAP/01-install.txt: -------------------------------------------------------------------------------- 1 | ~~~ XML::LibXML + libxml2-2.9.1 works with perl <=5.16.x only? ~~~ 2 | install XML::LibXML 3 | 4 | ~~~ see patch for Unicode::LineBreak ~~~ 5 | install Unicode::LineBreak 6 | 7 | 8 | install XML::Compile::SOAP 9 | 10 | 11 | ~~~ optionally ~~~ 12 | install XML::Compile::WSDL11 13 | -------------------------------------------------------------------------------- /doc/XML-LibXML/01_install.txt: -------------------------------------------------------------------------------- 1 | install XML::NamespaceSupport XML::SAX::Base XML::SAX 2 | install XML::LibXML 3 | 4 | 5 | Issue: 6 | 7 | Start tag expected, '<' not found 8 | 9 | Possible workaround: 10 | 11 | Don't upgrade/install modules which link against perl with -lz, 12 | like Compress::Zlib 13 | 14 | Tested on perl-5.16.3 15 | -------------------------------------------------------------------------------- /misc/backup-staticperl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # retrieve OS name 4 | OSNAME=$(uname -s) 5 | # dirpath where backups will be kept 6 | BACKUP_DIR="$HOME/backup/SP" 7 | # tar utility filepath 8 | # note: this file has been wroten with gtar in mind 9 | if [ ${OSNAME} = "SunOS" ]; then 10 | TAR="/usr/pkg/bin/gtar" 11 | elif [ ${OSNAME} = "OpenBSD" ]; then 12 | TAR="/usr/local/bin/gtar" 13 | else 14 | TAR=tar 15 | fi 16 | # filepath to staticperlrc file 17 | STATICPERLRC_FILE="$HOME/.staticperlrc" 18 | 19 | # read the staticperlrc configuration file 20 | # to retrieve a value of $STATICPERL variable, see below. 21 | if [ -r ${STATICPERLRC_FILE} ]; then 22 | . ${STATICPERLRC_FILE} 23 | else 24 | echo "Could not find file ${STATICPERLRC_FILE}" 25 | exit 1 26 | fi 27 | 28 | # staticperl installation directory 29 | PERL_DIR=$(basename ${STATICPERL}) 30 | # filename for an archive 31 | FILE=$(echo $PERL_DIR | sed 's/^\.//') 32 | # epoch time (note: on solaris an option "%s" does not provided) 33 | if [ ${OSNAME} = "SunOS" ]; then 34 | DATE=$(date +%Y%m%d_%H%M%S) 35 | else 36 | DATE=$(date +%s) 37 | fi 38 | # backup archive filename 39 | BACKUP_FILE="${BACKUP_DIR}/${FILE}-${DATE}.tar.gz" 40 | # list of backuped files and dirs 41 | FILES_LIST="${BACKUP_DIR}/${FILE}-${DATE}.filelist.txt" 42 | 43 | # create a backup directory if neccessary 44 | if [ ! -d ${BACKUP_DIR} ]; then 45 | echo -n "mkdir -p \`${BACKUP_DIR}'... " 46 | mkdir -p ${BACKUP_DIR} || exit 1 47 | echo "[ OK ]" 48 | fi 49 | 50 | # create an archive 51 | ${TAR} -zcvpf ${BACKUP_FILE} \ 52 | --directory=${HOME} \ 53 | --exclude="${PERL_DIR}/src/*" \ 54 | --exclude="${PERL_DIR}/cpan/build/*" \ 55 | --exclude="${PERL_DIR}/cpan/sources/*" \ 56 | --exclude="${PERL_DIR}/cache/*" \ 57 | ${PERL_DIR} > ${FILES_LIST} \ 58 | 2>&1 \ 59 | || exit 1 60 | 61 | echo ">>> ${BACKUP_FILE}" 62 | echo ">>> ${FILES_LIST}" 63 | 64 | exit 0 65 | -------------------------------------------------------------------------------- /misc/staticperl-path.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # prints a staticperl installation directory 5 | # 6 | 7 | RC_FILE=$HOME/.staticperlrc 8 | 9 | if [ -f $RC_FILE ]; then 10 | . $RC_FILE 11 | echo "${STATICPERL}/perl" 12 | fi 13 | 14 | exit 0 15 | -------------------------------------------------------------------------------- /modules/Config-Augeas-1.000/MANIFEST: -------------------------------------------------------------------------------- 1 | augeas-box/etc/hosts 2 | augeas-box/etc/ssh/ssh_config 3 | augeas-box/etc/ssh/sshd_config 4 | Augeas.xs 5 | ChangeLog 6 | lib/Config/Augeas.pm 7 | Makefile.PL 8 | MANIFEST This list of files 9 | MANIFEST.SKIP 10 | ppport.h 11 | README 12 | t/Config-Augeas.t 13 | t/Config-AugeasC.t 14 | t/pod.t 15 | typemap 16 | META.yml Module YAML meta-data (added by MakeMaker) 17 | META.json Module JSON meta-data (added by MakeMaker) 18 | -------------------------------------------------------------------------------- /modules/Config-Augeas-1.000/MANIFEST.SKIP: -------------------------------------------------------------------------------- 1 | Augeas.xs.orig 2 | ^Makefile$ 3 | Makefile.old 4 | ^MYMETA.* 5 | ^Config-Augeas- 6 | -------------------------------------------------------------------------------- /modules/Config-Augeas-1.000/META.json: -------------------------------------------------------------------------------- 1 | { 2 | "abstract" : "Edit configuration files through Augeas C library", 3 | "author" : [ 4 | "Raphaël Pinson (raphink at cpan dot org)" 5 | ], 6 | "dynamic_config" : 1, 7 | "generated_by" : "ExtUtils::MakeMaker version 7.1, CPAN::Meta::Converter version 2.150005", 8 | "license" : [ 9 | "open_source" 10 | ], 11 | "meta-spec" : { 12 | "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", 13 | "version" : "2" 14 | }, 15 | "name" : "Config-Augeas", 16 | "no_index" : { 17 | "directory" : [ 18 | "t", 19 | "inc" 20 | ] 21 | }, 22 | "prereqs" : { 23 | "build" : { 24 | "requires" : { 25 | "Test::More" : "0" 26 | } 27 | }, 28 | "configure" : { 29 | "requires" : { 30 | "ExtUtils::MakeMaker" : "0" 31 | } 32 | }, 33 | "runtime" : { 34 | "requires" : { 35 | "perl" : "5.008001" 36 | } 37 | } 38 | }, 39 | "release_status" : "stable", 40 | "version" : "1.000", 41 | "x_serialization_backend" : "JSON::PP version 2.27300" 42 | } 43 | -------------------------------------------------------------------------------- /modules/Config-Augeas-1.000/META.yml: -------------------------------------------------------------------------------- 1 | --- 2 | abstract: 'Edit configuration files through Augeas C library' 3 | author: 4 | - 'Raphaël Pinson (raphink at cpan dot org)' 5 | build_requires: 6 | Test::More: '0' 7 | configure_requires: 8 | ExtUtils::MakeMaker: '0' 9 | dynamic_config: 1 10 | generated_by: 'ExtUtils::MakeMaker version 7.1, CPAN::Meta::Converter version 2.150005' 11 | license: open_source 12 | meta-spec: 13 | url: http://module-build.sourceforge.net/META-spec-v1.4.html 14 | version: '1.4' 15 | name: Config-Augeas 16 | no_index: 17 | directory: 18 | - t 19 | - inc 20 | requires: 21 | perl: '5.008001' 22 | version: '1.000' 23 | x_serialization_backend: 'CPAN::Meta::YAML version 0.018' 24 | -------------------------------------------------------------------------------- /modules/Config-Augeas-1.000/augeas-box/etc/hosts: -------------------------------------------------------------------------------- 1 | 127.0.0.1 localhost localhost 2 | 192.168.0.1 bilbo 3 | -------------------------------------------------------------------------------- /modules/Config-Augeas-1.000/augeas-box/etc/ssh/ssh_config: -------------------------------------------------------------------------------- 1 | 2 | # This is the ssh client system-wide configuration file. See 3 | # ssh_config(5) for more information. This file provides defaults for 4 | # users, and the values can be changed in per-user configuration files 5 | # or on the command line. 6 | 7 | # Configuration data is parsed as follows: 8 | # 1. command line options 9 | # 2. user-specific file 10 | # 3. system-wide file 11 | # Any configuration value is only changed the first time it is set. 12 | # Thus, host-specific definitions should be at the beginning of the 13 | # configuration file, and defaults at the end. 14 | 15 | # Site-wide defaults for some commonly used options. For a comprehensive 16 | # list of available options, their meanings and defaults, please see the 17 | # ssh_config(5) man page. 18 | 19 | Host * 20 | # ForwardAgent no 21 | # ForwardX11 no 22 | # ForwardX11Trusted yes 23 | # RhostsRSAAuthentication no 24 | # RSAAuthentication yes 25 | # PasswordAuthentication yes 26 | # HostbasedAuthentication no 27 | # GSSAPIAuthentication no 28 | # GSSAPIDelegateCredentials no 29 | # GSSAPIKeyExchange no 30 | # GSSAPITrustDNS no 31 | # BatchMode no 32 | # CheckHostIP yes 33 | # AddressFamily any 34 | # ConnectTimeout 0 35 | # StrictHostKeyChecking ask 36 | # IdentityFile ~/.ssh/identity 37 | # IdentityFile ~/.ssh/id_rsa 38 | # IdentityFile ~/.ssh/id_dsa 39 | # Port 22 40 | # Protocol 2,1 41 | # Cipher 3des 42 | # Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc 43 | # MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160 44 | # EscapeChar ~ 45 | # Tunnel no 46 | # TunnelDevice any:any 47 | # PermitLocalCommand no 48 | SendEnv LANG LC_* 49 | HashKnownHosts yes 50 | GSSAPIAuthentication yes 51 | GSSAPIDelegateCredentials no 52 | -------------------------------------------------------------------------------- /modules/Config-Augeas-1.000/augeas-box/etc/ssh/sshd_config: -------------------------------------------------------------------------------- 1 | HostbasedAuthentication no 2 | HostKey /etc/ssh/ssh_host_key 3 | HostKey /etc/ssh/ssh_host_rsa_key 4 | HostKey /etc/ssh/ssh_host_dsa_key 5 | IgnoreRhosts yes 6 | KeyRegenerationInterval 3600 7 | Port 22 8 | LoginGraceTime 600 9 | LogLevel VERBOSE 10 | PasswordAuthentication yes 11 | PermitEmptyPasswords no 12 | PermitRootLogin no 13 | PrintLastLog yes 14 | PrintMotd no 15 | Protocol 2 16 | RhostsRSAAuthentication no 17 | RSAAuthentication yes 18 | ServerKeyBits 768 19 | StrictModes yes 20 | Subsystem sftp /usr/lib/openssh/sftp-server 21 | SyslogFacility AUTH 22 | TCPKeepAlive yes 23 | UsePAM yes 24 | X11DisplayOffset 10 25 | X11Forwarding yes 26 | Toto titi 27 | -------------------------------------------------------------------------------- /modules/Config-Augeas-1.000/t/pod.t: -------------------------------------------------------------------------------- 1 | # -*- cperl -*- 2 | 3 | use strict; 4 | use Test::More; 5 | eval "use Test::Pod 1.00"; 6 | plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; 7 | my @poddirs = qw( lib config-model-edit ); 8 | all_pod_files_ok( all_pod_files( @poddirs ) ); 9 | -------------------------------------------------------------------------------- /modules/Config-Augeas-1.000/typemap: -------------------------------------------------------------------------------- 1 | # See typemap section in perlxs man page for explanation on 2 | # on the fly conversion of Config::Augeas to Config_Augeas 3 | 4 | TYPEMAP 5 | Config_Augeas * T_PTROBJ_SPECIAL 6 | 7 | INPUT 8 | T_PTROBJ_SPECIAL 9 | if (sv_derived_from($arg, \"${(my $ntt=$ntype)=~s/_/::/g;\$ntt}\")) { 10 | IV tmp = SvIV((SV*)SvRV($arg)); 11 | $var = INT2PTR($type, tmp); 12 | } 13 | else 14 | croak(\"$var is not of type ${(my $ntt=$ntype)=~s/_/::/g;\$ntt}\") 15 | 16 | OUTPUT 17 | T_PTROBJ_SPECIAL 18 | sv_setref_pv($arg, \"${(my $ntt=$ntype)=~s/_/::/g;\$ntt}\", 19 | (void*)$var); 20 | 21 | -------------------------------------------------------------------------------- /modules/HTML-Escape-1.10/Changes: -------------------------------------------------------------------------------- 1 | Revision history for Perl extension HTML::Escape 2 | 3 | 1.10 2016-03-15T03:16:39Z 4 | 5 | - Performance improvement. 6 | Aaron Crane 7 | 8 | 1.09 2014-04-14T07:34:14Z 9 | 10 | - Escape '{' && '}' by default. 11 | https://github.com/angular/angular.js/issues/5601 12 | (tokuhirom) 13 | 14 | 1.08 2013-06-08T16:02:51Z 15 | 16 | - Escape backquote character for IE 17 | (Requested by John Siracusa) 18 | https://rt.cpan.org/Public/Bug/Display.html?id=84971 19 | 20 | 1.07 2013-06-08T04:59:08Z 21 | 22 | - use Minilla(no feature changes) 23 | 24 | 1.06 25 | 26 | - use M::B::Pluggable(No feature changes) 27 | 28 | 1.05 29 | 30 | - Fixed ppport.h generation logic. 31 | (tokuhirom) 32 | 33 | 1.04 34 | 35 | - fixed typo in dependency list. 36 | (Reported by syohex++) 37 | 38 | 1.03 39 | 40 | - depend to perl 5.8.5, gfx was tested on it. 41 | (gfx) 42 | 43 | 1.02 44 | 45 | [BUG FIX] 46 | - works on ithread enabled perl. 47 | 48 | 1.01 49 | 50 | - use Text::Xslate style pure perl module loading 51 | 52 | 1.00 53 | 54 | [INCOMPATIBLE CHANGE] 55 | - s/html_escape/escape_html/g 56 | 57 | 0.01 Sun Sep 30 15:09:52 2012 58 | - original version 59 | -------------------------------------------------------------------------------- /modules/HTML-Escape-1.10/MANIFEST: -------------------------------------------------------------------------------- 1 | author/benchmark.pl 2 | Changes 3 | Escape.xs 4 | lib/HTML/Escape.pm 5 | lib/HTML/Escape/PurePerl.pm 6 | LICENSE 7 | Makefile.PL 8 | MANIFEST This list of files 9 | ppport.h 10 | README.md 11 | t/00_compile.t 12 | t/01_simple.t 13 | t/02_pp.t 14 | xt/02_perlcritic.t 15 | META.yml Module YAML meta-data (added by MakeMaker) 16 | META.json Module JSON meta-data (added by MakeMaker) 17 | -------------------------------------------------------------------------------- /modules/HTML-Escape-1.10/META.json: -------------------------------------------------------------------------------- 1 | { 2 | "abstract" : "Extremely fast HTML escape", 3 | "author" : [ 4 | "Goro Fuji, Tokuhiro Matsuno " 5 | ], 6 | "dynamic_config" : 1, 7 | "generated_by" : "ExtUtils::MakeMaker version 7.1, CPAN::Meta::Converter version 2.150001", 8 | "license" : [ 9 | "perl_5" 10 | ], 11 | "meta-spec" : { 12 | "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", 13 | "version" : "2" 14 | }, 15 | "name" : "HTML-Escape", 16 | "no_index" : { 17 | "directory" : [ 18 | "t", 19 | "inc" 20 | ] 21 | }, 22 | "prereqs" : { 23 | "build" : { 24 | "requires" : { 25 | "Devel::PPPort" : "3.20", 26 | "Test::More" : "0.98", 27 | "Test::Requires" : "0" 28 | } 29 | }, 30 | "configure" : { 31 | "requires" : { 32 | "ExtUtils::MakeMaker" : "0" 33 | } 34 | }, 35 | "runtime" : { 36 | "requires" : {} 37 | } 38 | }, 39 | "release_status" : "stable", 40 | "version" : "1.10" 41 | } 42 | -------------------------------------------------------------------------------- /modules/HTML-Escape-1.10/META.yml: -------------------------------------------------------------------------------- 1 | --- 2 | abstract: 'Extremely fast HTML escape' 3 | author: 4 | - 'Goro Fuji, Tokuhiro Matsuno ' 5 | build_requires: 6 | Devel::PPPort: '3.20' 7 | Test::More: '0.98' 8 | Test::Requires: '0' 9 | configure_requires: 10 | ExtUtils::MakeMaker: '0' 11 | dynamic_config: 1 12 | generated_by: 'ExtUtils::MakeMaker version 7.1, CPAN::Meta::Converter version 2.150001' 13 | license: perl 14 | meta-spec: 15 | url: http://module-build.sourceforge.net/META-spec-v1.4.html 16 | version: '1.4' 17 | name: HTML-Escape 18 | no_index: 19 | directory: 20 | - t 21 | - inc 22 | requires: {} 23 | version: '1.10' 24 | -------------------------------------------------------------------------------- /modules/HTML-Escape-1.10/Makefile.PL: -------------------------------------------------------------------------------- 1 | use 5.008_001; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use ExtUtils::MakeMaker; 7 | 8 | WriteMakefile( 9 | dist => { 10 | PREOP => 'pod2text lib/HTML/Escape.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', 11 | COMPRESS => 'gzip -9v', 12 | SUFFIX => '.gz', 13 | }, 14 | NAME => 'HTML::Escape', 15 | DISTNAME => 'HTML-Escape', 16 | VERSION_FROM => 'lib/HTML/Escape.pm', 17 | OBJECT => '$(O_FILES)', 18 | ABSTRACT => 'Extremely fast HTML escape', 19 | AUTHOR => "Goro Fuji, Tokuhiro Matsuno ", 20 | LICENSE => 'perl', 21 | BUILD_REQUIRES => { # Taken from cpanfile 22 | "Devel::PPPort" => "3.20", 23 | "Test::More" => "0.98", 24 | "Test::Requires" => "0", 25 | }, 26 | PREREQ_PM => { 27 | 28 | } 29 | ); 30 | -------------------------------------------------------------------------------- /modules/HTML-Escape-1.10/README.md: -------------------------------------------------------------------------------- 1 | # NAME 2 | 3 | HTML::Escape - Extremely fast HTML escaping 4 | 5 | # SYNOPSIS 6 | 7 | use HTML::Escape qw/escape_html/; 8 | 9 | escape_html("<^o^>"); 10 | 11 | # DESCRIPTION 12 | 13 | This modules provides a function which escapes HTML's special characters. It 14 | performs a similar function to PHP's htmlspecialchars. 15 | 16 | This module uses XS for better performance, but it also provides a pure perl 17 | version. 18 | 19 | # FAQ 20 | 21 | - Is there also an unescape\_html? 22 | 23 | No. Unescaping HTML requires a lot of code, and we don't want to do it. 24 | Please use [HTML::Entities](https://metacpan.org/pod/HTML::Entities) for it. 25 | 26 | # BENCHMARK 27 | 28 | Rate HTML::Entities HTML::Escape 29 | HTML::Entities 14.0/s -- -91% 30 | HTML::Escape 150/s 975% -- 31 | 32 | # AUTHOR 33 | 34 | Goro Fuji 35 | 36 | Tokuhiro Matsuno <tokuhirom AAJKLFJEF@ GMAIL COM> 37 | 38 | # SEE ALSO 39 | 40 | [Text::Xslate](https://metacpan.org/pod/Text::Xslate), [HTML::Entities](https://metacpan.org/pod/HTML::Entities) 41 | 42 | # LICENSE 43 | 44 | Copyright (C) Tokuhiro Matsuno 45 | 46 | This library is free software; you can redistribute it and/or modify 47 | it under the same terms as Perl itself. 48 | -------------------------------------------------------------------------------- /modules/HTML-Escape-1.10/author/benchmark.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | use strict; 3 | use warnings; 4 | use utf8; 5 | use 5.010000; 6 | use autodie; 7 | 8 | use HTML::Escape; 9 | use HTML::Entities; 10 | use Benchmark ':all'; 11 | my $txt = "<=> (^^)" x 10000; 12 | 13 | cmpthese( 14 | -1, { 15 | "HTML::Escape" => sub { 16 | escape_html($txt); 17 | }, 18 | "HTML::Entities" => sub { 19 | encode_entities($txt); 20 | }, 21 | }, 22 | ); 23 | -------------------------------------------------------------------------------- /modules/HTML-Escape-1.10/lib/HTML/Escape/PurePerl.pm: -------------------------------------------------------------------------------- 1 | package HTML::Escape::PurePerl; 2 | use strict; 3 | use warnings; 4 | use utf8; 5 | 6 | die qq{Don't use HTML::Escape::PurePerl directly, use HTML::Escape instead.\n} # ' for poor editors 7 | if caller() ne 'HTML::Escape'; 8 | 9 | package # do not index, pause. 10 | HTML::Escape; 11 | 12 | our %_escape_table = ( '&' => '&', '>' => '>', '<' => '<', q{"} => '"', q{'} => ''', q{`} => '`', '{' => '{', '}' => '}' ); 13 | sub escape_html { 14 | my $str = shift; 15 | return '' 16 | unless defined $str; 17 | $str =~ s/([&><"'`{}])/$_escape_table{$1}/ge; #' for poor editors 18 | return $str; 19 | } 20 | 21 | 1; 22 | 23 | -------------------------------------------------------------------------------- /modules/HTML-Escape-1.10/t/00_compile.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use Test::More tests => 1; 3 | 4 | BEGIN { use_ok 'HTML::Escape' } 5 | -------------------------------------------------------------------------------- /modules/HTML-Escape-1.10/t/01_simple.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | use utf8; 4 | use Test::More; 5 | use HTML::Escape; 6 | 7 | ok(HTML::Escape::USE_XS, "uses XS module") or do { 8 | eval { XSLoader::load('HTML::Escape', $HTML::Escape::VERSION) }; 9 | diag $@ if $@; 10 | }; 11 | is(escape_html("<^o^>"), '<^o^>'); 12 | is(escape_html("'"), "'"); 13 | is(escape_html("\0>"), "\0>"); 14 | is(escape_html("`"), "`"); 15 | is(escape_html("{}"), "{}"); 16 | 17 | done_testing; 18 | 19 | -------------------------------------------------------------------------------- /modules/HTML-Escape-1.10/t/02_pp.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | use utf8; 4 | use Test::More; 5 | BEGIN { 6 | $ENV{PERL_ONLY} = 1; 7 | } 8 | use HTML::Escape; 9 | 10 | ok(!HTML::Escape::USE_XS); 11 | is(escape_html("<^o^>"), '<^o^>'); 12 | is(escape_html("'"), "'"); 13 | is(escape_html("\0>"), "\0>"); 14 | is(escape_html("`"), "`"); 15 | is(escape_html("{}"), "{}"); 16 | 17 | done_testing; 18 | 19 | -------------------------------------------------------------------------------- /modules/HTML-Escape-1.10/xt/02_perlcritic.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use Test::More; 3 | eval q{ 4 | use Test::Perl::Critic 1.02 -exclude => [ 5 | 'Subroutines::ProhibitSubroutinePrototypes', 6 | 'Subroutines::ProhibitExplicitReturnUndef', 7 | 'TestingAndDebugging::ProhibitNoStrict', 8 | 'ControlStructures::ProhibitMutatingListFunctions', 9 | ] 10 | }; 11 | plan skip_all => "Test::Perl::Critic 1.02+ is not installed." if $@; 12 | all_critic_ok('lib'); 13 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/MANIFEST: -------------------------------------------------------------------------------- 1 | Changes 2 | lib/Lexical/SealRequireHints.pm 3 | Makefile.PL 4 | MANIFEST This list of files 5 | README 6 | SealRequireHints.xs 7 | SIGNATURE 8 | t/before_warnings.t 9 | t/before_warnings_pp.t 10 | t/context.t 11 | t/context_0.pm 12 | t/context_1.pm 13 | t/context_2.pm 14 | t/context_pp.t 15 | t/defsv.t 16 | t/eval.t 17 | t/eval_0.pm 18 | t/eval_pp.t 19 | t/idempotent.t 20 | t/idempotent_pp.t 21 | t/override.t 22 | t/override_pp.t 23 | t/package.t 24 | t/package_0.pm 25 | t/package_pp.t 26 | t/pod_cvg.t 27 | t/pod_cvg_pp.t 28 | t/pod_syn.t 29 | t/seal.t 30 | t/seal_0.pm 31 | t/seal_1.pm 32 | t/seal_2.pm 33 | t/seal_3.pm 34 | t/seal_4.pm 35 | t/seal_pp.t 36 | t/setup_pp.pl 37 | t/swash.t 38 | t/swash_pp.t 39 | t/threads.t 40 | t/threads_pp.t 41 | t/version_check.t 42 | t/version_check_pp.t 43 | t/version_feature.t 44 | t/version_feature_pp.t 45 | META.yml Module YAML meta-data (added by MakeMaker) 46 | META.json Module JSON meta-data (added by MakeMaker) 47 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/META.json: -------------------------------------------------------------------------------- 1 | { 2 | "abstract" : "prevent leakage of lexical hints", 3 | "author" : [ 4 | "Andrew Main (Zefram) " 5 | ], 6 | "dynamic_config" : 1, 7 | "generated_by" : "ExtUtils::MakeMaker version 7.1, CPAN::Meta::Converter version 2.150001", 8 | "license" : [ 9 | "perl_5" 10 | ], 11 | "meta-spec" : { 12 | "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", 13 | "version" : "2" 14 | }, 15 | "name" : "Lexical-SealRequireHints", 16 | "no_index" : { 17 | "directory" : [ 18 | "t", 19 | "inc" 20 | ] 21 | }, 22 | "prereqs" : { 23 | "build" : { 24 | "requires" : { 25 | "ExtUtils::CBuilder" : "0.15", 26 | "Test::More" : "0" 27 | } 28 | }, 29 | "configure" : { 30 | "requires" : { 31 | "ExtUtils::MakeMaker" : "0" 32 | } 33 | }, 34 | "runtime" : { 35 | "requires" : { 36 | "ExtUtils::CBuilder" : "0.15" 37 | } 38 | } 39 | }, 40 | "release_status" : "stable", 41 | "version" : "0.010" 42 | } 43 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/META.yml: -------------------------------------------------------------------------------- 1 | --- 2 | abstract: 'prevent leakage of lexical hints' 3 | author: 4 | - 'Andrew Main (Zefram) ' 5 | build_requires: 6 | ExtUtils::CBuilder: '0.15' 7 | Test::More: '0' 8 | configure_requires: 9 | ExtUtils::MakeMaker: '0' 10 | dynamic_config: 1 11 | generated_by: 'ExtUtils::MakeMaker version 7.1, CPAN::Meta::Converter version 2.150001' 12 | license: perl 13 | meta-spec: 14 | url: http://module-build.sourceforge.net/META-spec-v1.4.html 15 | version: '1.4' 16 | name: Lexical-SealRequireHints 17 | no_index: 18 | directory: 19 | - t 20 | - inc 21 | requires: 22 | ExtUtils::CBuilder: '0.15' 23 | version: '0.010' 24 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/Makefile.PL: -------------------------------------------------------------------------------- 1 | { use 5.006; } 2 | use warnings; 3 | use strict; 4 | 5 | use ExtUtils::MakeMaker; 6 | 7 | my $require_xs = "$]" < 5.007002 || ("$]" >= 5.009004 && "$]" < 5.010001); 8 | 9 | # TODO: somehow tell ExtUtils::MakeMaker about conflicts. 10 | # In the case of this module should be a conflict module is 11 | # "B::Hooks::OP::Check" => "< 0.19" 12 | 13 | WriteMakefile( 14 | dist => { 15 | PREOP => 'pod2text lib/Lexical/SealRequireHints.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', 16 | COMPRESS => 'gzip -9v', 17 | SUFFIX => '.gz', 18 | }, 19 | NAME => 'Lexical::SealRequireHints', 20 | VERSION_FROM => 'lib/Lexical/SealRequireHints.pm', 21 | OBJECT => '$(O_FILES)', 22 | ABSTRACT => 'prevent leakage of lexical hints', 23 | AUTHOR => 'Andrew Main (Zefram) ', 24 | LICENSE => 'perl_5', 25 | BUILD_REQUIRES => { 26 | ($require_xs ? () : ( 27 | "ExtUtils::CBuilder" => "0.15", 28 | )), 29 | }, 30 | TEST_REQUIRES => { 31 | "Test::More" => 0, 32 | }, 33 | PREREQ_PM => { 34 | ($require_xs ? () : ( 35 | "ExtUtils::CBuilder" => "0.15", 36 | )), 37 | }, 38 | SIGN => 0, 39 | XS => { 40 | # On MSWin32, the XS version of the workaround can't work 41 | # properly, because it doesn't have access to the core 42 | # symbols to let SAVEHINTS() work. 43 | ("$]" < 5.012 && $^O eq "MSWin32") ? 44 | () : ('SealRequireHints.xs' => 'SealRequireHints.c') 45 | }, 46 | # need PERL_CORE for working SAVEHINTS() 47 | DEFINE => "$]" < 5.012 ? '-DPERL_CORE' : '', 48 | ); 49 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/before_warnings.t: -------------------------------------------------------------------------------- 1 | # This script checks whether L:SRH takes effect sufficiently early. It is 2 | # specifically concerned with the "require Carp" or "require Carp::Heavy" 3 | # that warnings.pm may execute in a delayed manner. Either it must 4 | # be possible to delay loading warnings.pm until after L:SRH has taken 5 | # effect, so that its require statements will be appropriately altered 6 | # to avoid hint leakage, or L:SRH must cause Carp to load, so that it's 7 | # loaded without problematic hints in existence. We test this by loading 8 | # L:SRH first thing, and checking what's been loaded. This script, 9 | # as a result, can't use warnings.pm or anything that might load it. 10 | # The test is only applied on Perls where L:SRH makes a difference, 11 | # so that infrastructure modules can start using warnings in the future. 12 | 13 | BEGIN { 14 | if("$]" >= 5.012) { 15 | print "1..0 # SKIP no problem on this Perl\n"; 16 | exit 0; 17 | } 18 | } 19 | 20 | BEGIN { print "1..1\n"; } 21 | 22 | use Lexical::SealRequireHints; 23 | BEGIN { 24 | if(exists($INC{"warnings.pm"}) && 25 | !(exists($INC{"Carp.pm"}) && 26 | exists($INC{"Carp/Heavy.pm"}))) { 27 | print "not ok 1\n"; 28 | exit 1; 29 | } 30 | } 31 | 32 | print "ok 1\n"; 33 | exit 0; 34 | 35 | 1; 36 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/before_warnings_pp.t: -------------------------------------------------------------------------------- 1 | # No "use warnings" here because of the unique requirements of 2 | # before_warnings.t. 3 | 4 | do "t/setup_pp.pl" or die $@ || $!; 5 | do "t/before_warnings.t" or die $@ || $!; 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/context.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | use Test::More tests => 14; 5 | 6 | BEGIN { use_ok "Lexical::SealRequireHints"; } 7 | 8 | my $retval; 9 | 10 | eval { $retval = require t::context_0; 1 }; 11 | is $@, ""; 12 | is $retval, "t::context_0 return"; 13 | 14 | eval { $retval = require t::context_0; 1 }; 15 | is $@, ""; 16 | is $retval, 1; 17 | 18 | eval { $retval = [ require t::context_1 ]; 1 }; 19 | is $@, ""; 20 | is_deeply $retval, ["t::context_1 return"]; 21 | 22 | eval { $retval = [ require t::context_1 ]; 1 }; 23 | is $@, ""; 24 | is_deeply $retval, [1]; 25 | 26 | eval { require t::context_2; 1 }; 27 | is $@, ""; 28 | 29 | eval { require t::context_2; 1 }; 30 | is $@, ""; 31 | 32 | sub diecxt() { 33 | die wantarray ? "ARRAY\n" : defined(wantarray) ? "SCALAR\n" : "VOID\n"; 34 | } 35 | eval { $retval = require(diecxt()); 1 }; 36 | is $@, "SCALAR\n"; 37 | eval { $retval = [ require(diecxt()) ]; 1 }; 38 | is $@, "SCALAR\n"; 39 | eval { require(diecxt()); 1 }; 40 | is $@, "SCALAR\n"; 41 | 42 | 1; 43 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/context_0.pm: -------------------------------------------------------------------------------- 1 | package t::context_0; 2 | 3 | { use 5.006; } 4 | use warnings; 5 | use strict; 6 | 7 | die "t::context_0 sees array context at file scope" if wantarray; 8 | die "t::context_0 sees void context at file scope" unless defined wantarray; 9 | 10 | "t::context_0 return"; 11 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/context_1.pm: -------------------------------------------------------------------------------- 1 | package t::context_1; 2 | 3 | { use 5.006; } 4 | use warnings; 5 | use strict; 6 | 7 | die "t::context_1 sees array context at file scope" if wantarray; 8 | die "t::context_1 sees void context at file scope" unless defined wantarray; 9 | 10 | "t::context_1 return"; 11 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/context_2.pm: -------------------------------------------------------------------------------- 1 | package t::context_2; 2 | 3 | { use 5.006; } 4 | use warnings; 5 | use strict; 6 | 7 | die "t::context_2 sees array context at file scope" if wantarray; 8 | die "t::context_2 sees void context at file scope" unless defined wantarray; 9 | 10 | "t::context_2 return"; 11 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/context_pp.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | do "t/setup_pp.pl" or die $@ || $!; 5 | do "t/context.t" or die $@ || $!; 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/defsv.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | use Test::More tests => 5; 5 | 6 | BEGIN { use_ok "Lexical::SealRequireHints"; } 7 | 8 | SKIP: { 9 | skip "CORE::GLOBAL::require breaks require() on this perl", 4 10 | if defined(&CORE::GLOBAL::require) && "$]" < 5.015005; 11 | my $retval; 12 | eval q{ our $_ = "t/context_0.pm"; $retval = require; 1 }; 13 | is $@, ""; 14 | is $retval, "t::context_0 return"; 15 | SKIP: { 16 | skip "no lexical \$_ on this perl", 2 17 | if "$]" < 5.009001 || "$]" >= 5.023004; 18 | eval q{ 19 | no warnings "$]" >= 5.017009 ? "experimental" : 20 | "deprecated"; 21 | my $_ = "t/context_1.pm"; 22 | $retval = require; 23 | 1; 24 | }; 25 | is $@, ""; 26 | is $retval, "t::context_1 return"; 27 | } 28 | } 29 | 30 | 1; 31 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/eval.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | BEGIN { 5 | if("$]" < 5.006001) { 6 | require Test::More; 7 | Test::More::plan(skip_all => "core bug makes this test crash"); 8 | } 9 | } 10 | 11 | use Test::More tests => 5; 12 | 13 | BEGIN { use_ok "Lexical::SealRequireHints"; } 14 | 15 | use t::eval_0; 16 | 17 | ok 1; 18 | 19 | 1; 20 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/eval_0.pm: -------------------------------------------------------------------------------- 1 | package t::eval_0; 2 | 3 | use warnings; 4 | use strict; 5 | 6 | use Test::More 0.41; 7 | 8 | sub _ok_no_eval() { 9 | my $lastsub = ""; 10 | my $i = 0; 11 | while(1) { 12 | my @c = caller($i); 13 | unless(@c) { 14 | ok 0; 15 | diag "failed to find main program in stack trace"; 16 | return; 17 | } 18 | my $sub = $c[3]; 19 | if($sub eq "main::BEGIN") { 20 | ok 1; 21 | return; 22 | } 23 | my $type = $sub ne "(eval)" ? "subroutine" : 24 | $c[7] ? "require" : 25 | defined($c[6]) ? "string eval" : "block eval"; 26 | if($type =~ /eval/ && !($lastsub eq "t::eval_0::BEGIN" && 27 | $type eq "block eval")) { 28 | ok 0; 29 | diag "have $type between module and main program"; 30 | return; 31 | } 32 | $lastsub = $sub; 33 | $i++; 34 | } 35 | } 36 | 37 | BEGIN { _ok_no_eval(); } 38 | _ok_no_eval(); 39 | sub import { _ok_no_eval(); } 40 | 41 | 1; 42 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/eval_pp.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | do "t/setup_pp.pl" or die $@ || $!; 5 | do "t/eval.t" or die $@ || $!; 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/idempotent.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | alarm 10; 5 | 6 | use Lexical::SealRequireHints; 7 | do "t/seal.t" or die $@ || $!; 8 | 9 | 1; 10 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/idempotent_pp.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | do "t/setup_pp.pl" or die $@ || $!; 5 | do "t/idempotent.t" or die $@ || $!; 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/override.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | BEGIN { 5 | if("$]" < 5.007002) { 6 | require Test::More; 7 | Test::More::plan(skip_all => 8 | "CORE::GLOBAL::require can't work on this perl"); 9 | } 10 | } 11 | 12 | use Test::More tests => 10; 13 | 14 | our @warnings; 15 | BEGIN { 16 | $^W = 1; 17 | $SIG{__WARN__} = sub { push @warnings, $_[0] }; 18 | } 19 | 20 | our $have_runtime_hint_hash; 21 | BEGIN { $have_runtime_hint_hash = "$]" >= 5.009004; } 22 | sub test_runtime_hint_hash($$) { 23 | SKIP: { 24 | skip "no runtime hint hash", 1 unless $have_runtime_hint_hash; 25 | is +((caller(0))[10] || {})->{$_[0]}, $_[1]; 26 | } 27 | } 28 | 29 | our @require_activity; 30 | 31 | BEGIN { 32 | my $next_require = defined(&CORE::GLOBAL::require) ? 33 | \&CORE::GLOBAL::require : sub { CORE::require($_[0]) }; 34 | no warnings "redefine"; 35 | *CORE::GLOBAL::require = sub { 36 | push @require_activity, "a"; 37 | return $next_require->(@_); 38 | }; 39 | } 40 | 41 | BEGIN { use_ok "Lexical::SealRequireHints"; } 42 | 43 | BEGIN { 44 | my $next_require = defined(&CORE::GLOBAL::require) ? 45 | \&CORE::GLOBAL::require : sub { CORE::require($_[0]) }; 46 | no warnings "redefine"; 47 | no warnings "prototype"; 48 | *CORE::GLOBAL::require = sub ($) { 49 | push @require_activity, "b"; 50 | return $next_require->(@_); 51 | }; 52 | } 53 | 54 | BEGIN { 55 | $^H |= 0x20000 if "$]" < 5.009004; 56 | $^H{"Lexical::SealRequireHints/test"} = 1; 57 | } 58 | 59 | BEGIN { 60 | is $^H{"Lexical::SealRequireHints/test"}, 1; 61 | @require_activity = (); 62 | } 63 | use t::seal_0; 64 | BEGIN { 65 | is $^H{"Lexical::SealRequireHints/test"}, 1; 66 | is $^H{"Lexical::SealRequireHints/test0"}, 1; 67 | isnt scalar(@require_activity), 0; 68 | is_deeply \@require_activity, [("b","a") x (@require_activity>>1)]; 69 | } 70 | 71 | is_deeply \@warnings, []; 72 | 73 | 1; 74 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/override_pp.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | do "t/setup_pp.pl" or die $@ || $!; 5 | do "t/override.t" or die $@ || $!; 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/package.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | use Test::More tests => 2; 5 | 6 | our $native_package; 7 | 8 | BEGIN { 9 | our $package; 10 | { 11 | package Foo; 12 | require t::package_0; 13 | } 14 | $native_package = $package; 15 | $package = undef; 16 | delete $INC{"t/package_0.pm"}; 17 | } 18 | 19 | BEGIN { use_ok "Lexical::SealRequireHints"; } 20 | 21 | our $package; 22 | { 23 | package Foo; 24 | require t::package_0; 25 | } 26 | is $package, $native_package; 27 | 28 | 1; 29 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/package_0.pm: -------------------------------------------------------------------------------- 1 | $main::package = __PACKAGE__; 2 | 1; 3 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/package_pp.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | do "t/setup_pp.pl" or die $@ || $!; 5 | do "t/package.t" or die $@ || $!; 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/pod_cvg.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | use Test::More; 5 | plan skip_all => "Test::Pod::Coverage not available" 6 | unless eval "use Test::Pod::Coverage; 1"; 7 | Test::Pod::Coverage::all_pod_coverage_ok({also_private=>[qr/\Aunimport\z/]}); 8 | 9 | 1; 10 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/pod_cvg_pp.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | do "t/setup_pp.pl" or die $@ || $!; 5 | do "t/pod_cvg.t" or die $@ || $!; 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/pod_syn.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | use Test::More; 5 | plan skip_all => "Test::Pod not available" unless eval "use Test::Pod 1.00; 1"; 6 | Test::Pod::all_pod_files_ok(); 7 | 8 | 1; 9 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/seal_0.pm: -------------------------------------------------------------------------------- 1 | package t::seal_0; 2 | 3 | use warnings; 4 | use strict; 5 | 6 | use Test::More; 7 | 8 | BEGIN { is $^H{"Lexical::SealRequireHints/test"}, undef; } 9 | main::test_runtime_hint_hash "Lexical::SealRequireHints/test", undef; 10 | 11 | sub import { 12 | is $^H{"Lexical::SealRequireHints/test"}, 1; 13 | $^H |= 0x20000 if "$]" < 5.009004; 14 | $^H{"Lexical::SealRequireHints/test0"}++; 15 | } 16 | 17 | 1; 18 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/seal_1.pm: -------------------------------------------------------------------------------- 1 | package t::seal_1; 2 | 3 | use warnings; 4 | use strict; 5 | 6 | use Test::More; 7 | 8 | BEGIN { is $^H{"Lexical::SealRequireHints/test"}, undef; } 9 | main::test_runtime_hint_hash "Lexical::SealRequireHints/test", undef; 10 | 11 | sub import { 12 | is $^H{"Lexical::SealRequireHints/test"}, 1; 13 | $^H |= 0x20000 if "$]" < 5.009004; 14 | $^H{"Lexical::SealRequireHints/test1"}++; 15 | } 16 | 17 | 1; 18 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/seal_2.pm: -------------------------------------------------------------------------------- 1 | package t::seal_2; 2 | 3 | use warnings; 4 | use strict; 5 | 6 | 10; 7 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/seal_3.pm: -------------------------------------------------------------------------------- 1 | package t::seal_3; 2 | 3 | use warnings; 4 | use strict; 5 | 6 | BEGIN { die "seal_3 death\n"; } 7 | 8 | 1; 9 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/seal_4.pm: -------------------------------------------------------------------------------- 1 | package t::seal_4; 2 | 3 | use warnings; 4 | use strict; 5 | 6 | die "seal_4 death\n"; 7 | 8 | 1; 9 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/seal_pp.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | do "t/setup_pp.pl" or die $@ || $!; 5 | do "t/seal.t" or die $@ || $!; 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/setup_pp.pl: -------------------------------------------------------------------------------- 1 | if("$]" < 5.007002 || ("$]" >= 5.009004 && "$]" < 5.010001)) { 2 | require Test::More; 3 | Test::More::plan(skip_all => 4 | "pure Perl Lexical::SealRequireHints can't work on this perl"); 5 | } 6 | 7 | require XSLoader; 8 | 9 | my $orig_load = \&XSLoader::load; 10 | # Suppress redefinition warning, without loading warnings.pm, for the 11 | # benefit of before_warnings.t. 12 | BEGIN { ${^WARNING_BITS} = ""; } 13 | *XSLoader::load = sub { 14 | die "XS loading disabled for Lexical::SealRequireHints" 15 | if ($_[0] || "") eq "Lexical::SealRequireHints"; 16 | goto &$orig_load; 17 | }; 18 | 19 | 1; 20 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/swash.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | BEGIN { 5 | if("$]" < 5.008) { 6 | require Test::More; 7 | Test::More::plan(skip_all => 8 | "swash loading disagrees with infrastructure"); 9 | } 10 | } 11 | 12 | use Test::More tests => 6; 13 | 14 | use Lexical::SealRequireHints; 15 | 16 | BEGIN { 17 | SKIP: { 18 | skip "Perl 5.11 doesn't work with localised hint bit", 2 19 | if "$]" >= 5.011 && "$]" < 5.012; 20 | $^H = 0; 21 | is $^H, 0; 22 | require t::package_0; 23 | is $^H, 0; 24 | } 25 | } 26 | 27 | BEGIN { 28 | %^H = ( foo=>1, bar=>2 ); 29 | $^H |= 0x20000; 30 | is_deeply [ sort keys(%^H) ], [qw(bar foo)]; 31 | if(exists $INC{"utf8.pm"}) { 32 | SKIP: { 33 | skip "utf8.pm loaded too early ". 34 | "(breaking following tests)", 1; 35 | } 36 | } else { 37 | pass; 38 | } 39 | } 40 | BEGIN { 41 | # Up to Perl 5.7.0, it is the compilation of this regexp match 42 | # that triggers swash loading. From Perl 5.7.1 onwards, it 43 | # is the execution. Hence for this test we must arrange for 44 | # both to occur between the surrounding segments of test code. 45 | # A BEGIN block achieves this nicely. 46 | my $x = "foo\x{666}"; 47 | $x =~ /foo\p{Alnum}/; 48 | } 49 | BEGIN { 50 | ok exists($INC{"utf8.pm"}); 51 | is_deeply [ sort keys(%^H) ], [qw(bar foo)]; 52 | } 53 | 54 | 1; 55 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/swash_pp.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | do "t/setup_pp.pl" or die $@ || $!; 5 | do "t/swash.t" or die $@ || $!; 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/threads.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | BEGIN { 5 | eval { require threads; }; 6 | if($@ =~ /\AThis Perl not built to support threads/) { 7 | require Test::More; 8 | Test::More::plan(skip_all => "non-threading perl build"); 9 | } 10 | if($@ ne "") { 11 | require Test::More; 12 | Test::More::plan(skip_all => "threads unavailable"); 13 | } 14 | eval { require Thread::Semaphore; }; 15 | if($@ ne "") { 16 | require Test::More; 17 | Test::More::plan(skip_all => "Thread::Semaphore unavailable"); 18 | } 19 | eval { require threads::shared; }; 20 | if($@ ne "") { 21 | require Test::More; 22 | Test::More::plan(skip_all => "threads::shared unavailable"); 23 | } 24 | } 25 | 26 | use threads; 27 | 28 | use Test::More tests => 3; 29 | use Thread::Semaphore (); 30 | use threads::shared; 31 | 32 | alarm 10; # failure mode may involve an infinite loop 33 | 34 | my $done1 = Thread::Semaphore->new(0); 35 | my $exit1 = Thread::Semaphore->new(0); 36 | my $done2 = Thread::Semaphore->new(0); 37 | my $exit2 = Thread::Semaphore->new(0); 38 | 39 | my $ok1 :shared; 40 | my $thread1 = threads->create(sub { 41 | my $ok = 1; 42 | eval(q{ 43 | use Lexical::SealRequireHints; 44 | require t::context_1; 45 | 1; 46 | }) or $ok = 0; 47 | $ok1 = $ok; 48 | $done1->up; 49 | $exit1->down; 50 | }); 51 | $done1->down; 52 | ok $ok1; 53 | 54 | my $ok2 :shared; 55 | my $thread2 = threads->create(sub { 56 | my $ok = 1; 57 | eval(q{ 58 | use Lexical::SealRequireHints; 59 | require t::context_2; 60 | 1; 61 | }) or $ok = 0; 62 | $ok2 = $ok; 63 | $done2->up; 64 | $exit2->down; 65 | }); 66 | $done2->down; 67 | ok $ok2; 68 | 69 | $exit1->up; 70 | $exit2->up; 71 | $thread1->join; 72 | $thread2->join; 73 | ok 1; 74 | 75 | 1; 76 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/threads_pp.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | do "t/setup_pp.pl" or die $@ || $!; 5 | do "t/threads.t" or die $@ || $!; 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/version_check.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | use Test::More tests => 19; 5 | 6 | BEGIN { use_ok "Lexical::SealRequireHints"; } 7 | 8 | no warnings "portable"; 9 | 10 | foreach( 11 | q{ use 5.006; }, 12 | q{ use 5.6.0; }, 13 | q{ use v5.6.0; }, 14 | q{ require 5.006; }, 15 | q{ require 5.6.0; }, 16 | q{ require v5.6.0; }, 17 | q{ require(5.006); }, 18 | ("$]" >= 5.009002 ? ( 19 | q{ my $v = 5.6.0; require($v); }, 20 | q{ my $v = 5.6.0; require($v); }, 21 | ) : ("", "")), 22 | ) { 23 | eval $_; 24 | is $@, ""; 25 | } 26 | 27 | foreach( 28 | q{ use 6.006; }, 29 | q{ use 6.6.0; }, 30 | q{ use v6.6.0; }, 31 | q{ require 6.006; }, 32 | q{ require 6.6.0; }, 33 | q{ require v6.6.0; }, 34 | q{ require(6.006); }, 35 | ("$]" >= 5.009002 ? ( 36 | q{ my $v = 6.6.0; require($v); }, 37 | q{ my $v = 6.6.0; require($v); }, 38 | ) : ("use 6.006;", "use 6.006;")), 39 | ) { 40 | eval $_; 41 | like $@, qr/\APerl v6\.6\.0 required/; 42 | } 43 | 44 | 1; 45 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/version_check_pp.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | do "t/setup_pp.pl" or die $@ || $!; 5 | do "t/version_check.t" or die $@ || $!; 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/version_feature.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | BEGIN { 5 | if("$]" < 5.009005) { 6 | require Test::More; 7 | Test::More::plan(skip_all => 8 | "no version-implied features on this perl"); 9 | } 10 | } 11 | 12 | use Test::More tests => 4; 13 | 14 | BEGIN { use_ok "Lexical::SealRequireHints"; } 15 | 16 | eval q{ 17 | use 5.009005; 18 | sub t0 { say "foo"; } 19 | }; 20 | is $@, ""; 21 | 22 | eval q{ 23 | no warnings "portable"; 24 | use 5.9.5; 25 | sub t1 { say "foo"; } 26 | }; 27 | is $@, ""; 28 | 29 | eval q{ 30 | no warnings "portable"; 31 | use v5.9.5; 32 | sub t2 { say "foo"; } 33 | }; 34 | is $@, ""; 35 | 36 | 1; 37 | -------------------------------------------------------------------------------- /modules/Lexical-SealRequireHints-0.010/t/version_feature_pp.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | do "t/setup_pp.pl" or die $@ || $!; 5 | do "t/version_feature.t" or die $@ || $!; 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /modules/Params-Classify-0.013/MANIFEST: -------------------------------------------------------------------------------- 1 | Changes 2 | MANIFEST 3 | META.yml 4 | Makefile.PL 5 | README 6 | lib/Params/Classify.pm 7 | Classify.xs 8 | t/blessed.t 9 | t/blessed_pp.t 10 | t/check.t 11 | t/check_pp.t 12 | t/classify.t 13 | t/classify_pp.t 14 | t/error.t 15 | t/error_pp.t 16 | t/pod_cvg.t 17 | t/pod_cvg_pp.t 18 | t/pod_syn.t 19 | t/ref.t 20 | t/ref_pp.t 21 | t/setup_pp.pl 22 | -------------------------------------------------------------------------------- /modules/Params-Classify-0.013/META.yml: -------------------------------------------------------------------------------- 1 | --- 2 | abstract: 'argument type classification' 3 | author: 4 | - 'Andrew Main (Zefram) ' 5 | build_requires: 6 | ExtUtils::ParseXS: 2.2006 7 | Module::Build: 0 8 | Test::More: 0 9 | perl: 5.006001 10 | strict: 0 11 | warnings: 0 12 | configure_requires: 13 | Module::Build: 0 14 | perl: 5.006001 15 | strict: 0 16 | warnings: 0 17 | distribution_type: module 18 | dynamic_config: 1 19 | generated_by: 'Module::Build version 0.3607' 20 | license: perl 21 | meta-spec: 22 | url: http://module-build.sourceforge.net/META-spec-v1.4.html 23 | version: 1.4 24 | name: Params-Classify 25 | provides: 26 | Params::Classify: 27 | file: lib/Params/Classify.pm 28 | version: 0.013 29 | recommends: 30 | XSLoader: 0 31 | requires: 32 | Exporter: 0 33 | Scalar::Util: 1.01 34 | parent: 0 35 | perl: 5.006001 36 | strict: 0 37 | warnings: 0 38 | resources: 39 | license: http://dev.perl.org/licenses/ 40 | version: 0.013 41 | -------------------------------------------------------------------------------- /modules/Params-Classify-0.013/Makefile.PL: -------------------------------------------------------------------------------- 1 | use ExtUtils::MakeMaker; 2 | 3 | WriteMakefile( 4 | dist => { 5 | PREOP => 'pod2text lib/Params/Classify.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', 6 | COMPRESS => 'gzip -9v', 7 | SUFFIX => '.gz', 8 | }, 9 | NAME => 'Params::Classify', 10 | AUTHOR => 'Andrew Main (Zefram) ', 11 | ABSTRACT => 'Params::Classify - argument type classification', 12 | DISTNAME => 'Params-Classify', 13 | LICENSE => 'perl', 14 | BUILD_REQUIRES => { 15 | "ExtUtils::ParseXS" => "2.2006", 16 | "Test::More" => 0, 17 | "strict" => 0, 18 | "warnings" => 0, 19 | }, 20 | PREREQ_PM => { 21 | "Exporter" => 0, 22 | "Scalar::Util" => "1.01", 23 | "parent" => 0, 24 | "strict" => 0, 25 | "warnings" => 0, 26 | }, 27 | VERSION_FROM => 'lib/Params/Classify.pm', 28 | ); 29 | -------------------------------------------------------------------------------- /modules/Params-Classify-0.013/README: -------------------------------------------------------------------------------- 1 | NAME 2 | 3 | Params::Classify - argument type classification 4 | 5 | DESCRIPTION 6 | 7 | This module provides various type-testing functions. These are intended 8 | for functions that, unlike most Perl code, care what type of data they 9 | are operating on. For example, some functions wish to behave differently 10 | depending on the type of their arguments (like overloaded functions 11 | in C++). 12 | 13 | There are two flavours of function in this module. Functions of the first 14 | flavour only provide type classification, to allow code to discriminate 15 | between argument types. Functions of the second flavour package up the 16 | most common type of type discrimination: checking that an argument is 17 | of an expected type. The functions come in matched pairs, of the two 18 | flavours, and so the type enforcement functions handle only the simplest 19 | requirements for arguments of the types handled by the classification 20 | functions. Enforcement of more complex types may, of course, be built 21 | using the classification functions, or it may be more convenient to use 22 | a module designed for the more complex job, such as L. 23 | 24 | This module is implemented in XS, with a pure Perl backup version for 25 | systems that can't handle XS. 26 | 27 | INSTALLATION 28 | 29 | perl Build.PL 30 | ./Build 31 | ./Build test 32 | ./Build install 33 | 34 | AUTHOR 35 | 36 | Andrew Main (Zefram) 37 | 38 | COPYRIGHT 39 | 40 | Copyright (C) 2004, 2006, 2007, 2009, 2010 41 | Andrew Main (Zefram) 42 | 43 | Copyright (C) 2009, 2010 PhotoBox Ltd 44 | 45 | LICENSE 46 | 47 | This module is free software; you can redistribute it and/or modify it 48 | under the same terms as Perl itself. 49 | -------------------------------------------------------------------------------- /modules/Params-Classify-0.013/t/blessed.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | use Test::More tests => 1 + 2*(4 + 2*4 + 5)*8; 5 | 6 | @B::ISA = qw(A); 7 | 8 | sub A::flange { } 9 | 10 | BEGIN { 11 | use_ok "Params::Classify", qw( 12 | is_blessed blessed_class is_strictly_blessed is_able 13 | ); 14 | } 15 | 16 | my @class_names = qw(UNIVERSAL qwerty A B); 17 | my @method_names = qw(qwerty can isa print flange); 18 | 19 | sub test_blessed($$@) { 20 | my($scalar, $class, $isb, @expect) = @_; 21 | is(blessed_class($scalar), $class); 22 | is(&blessed_class($scalar), $class); 23 | is(!!is_blessed($scalar), !!$isb); 24 | is(!!&is_blessed($scalar), !!$isb); 25 | is(!!is_strictly_blessed($scalar), !!$isb); 26 | is(!!&is_strictly_blessed($scalar), !!$isb); 27 | is(!!is_able($scalar), !!$isb); 28 | is(!!&is_able($scalar), !!$isb); 29 | foreach my $cn (@class_names) { 30 | my $state = shift(@expect); 31 | is(!!is_blessed($scalar, $cn), !!$state); 32 | is(!!&is_blessed($scalar, $cn), !!$state); 33 | is(!!is_strictly_blessed($scalar, $cn), $state eq 2); 34 | is(!!&is_strictly_blessed($scalar, $cn), $state eq 2); 35 | } 36 | foreach my $mn (@method_names) { 37 | my $expect = !!shift(@expect); 38 | is(!!is_able($scalar, $mn), $expect); 39 | is(!!&is_able($scalar, $mn), $expect); 40 | } 41 | } 42 | 43 | test_blessed(undef, undef, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); 44 | test_blessed("foo", undef, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); 45 | test_blessed(123, undef, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); 46 | test_blessed(*STDOUT, undef, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); 47 | test_blessed({}, undef, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); 48 | 49 | test_blessed(bless({}, "main"), "main", 1, 1, 0, 0, 0, 0, 1, 1, 0, 0); 50 | test_blessed(bless({}, "A"), "A", 1, 1, 0, 2, 0, 0, 1, 1, 0, 1); 51 | test_blessed(bless({}, "B"), "B", 1, 1, 0, 1, 2, 0, 1, 1, 0, 1); 52 | 53 | 1; 54 | -------------------------------------------------------------------------------- /modules/Params-Classify-0.013/t/blessed_pp.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | do "t/setup_pp.pl" or die $@ || $!; 5 | do "t/blessed.t" or die $@ || $!; 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /modules/Params-Classify-0.013/t/check_pp.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | do "t/setup_pp.pl" or die $@ || $!; 5 | do "t/check.t" or die $@ || $!; 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /modules/Params-Classify-0.013/t/classify.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | use Test::More tests => 1 + 2*8*11; 5 | 6 | BEGIN { 7 | use_ok "Params::Classify", qw( 8 | scalar_class is_undef is_string 9 | is_number is_glob is_regexp is_ref is_blessed 10 | ); 11 | } 12 | 13 | sub test_scalar_classification($$$$$$$$$) { 14 | my(undef, $class, $iu, $is, $in, $ig, $ix, $ir, $ib) = @_; 15 | is(scalar_class($_[0]), $class); 16 | is(&scalar_class($_[0]), $class); 17 | is(!!is_undef($_[0]), !!$iu); 18 | is(!!&is_undef($_[0]), !!$iu); 19 | is(!!is_string($_[0]), !!$is); 20 | is(!!&is_string($_[0]), !!$is); 21 | is(!!is_number($_[0]), !!$in); 22 | is(!!&is_number($_[0]), !!$in); 23 | is(!!is_glob($_[0]), !!$ig); 24 | is(!!&is_glob($_[0]), !!$ig); 25 | is(!!is_regexp($_[0]), !!$ix); 26 | is(!!&is_regexp($_[0]), !!$ix); 27 | is(!!is_ref($_[0]), !!$ir); 28 | is(!!&is_ref($_[0]), !!$ir); 29 | is(!!is_blessed($_[0]), !!$ib); 30 | is(!!&is_blessed($_[0]), !!$ib); 31 | } 32 | 33 | test_scalar_classification(undef, "UNDEF", 1, 0, 0, 0, 0, 0, 0); 34 | test_scalar_classification("", "STRING", 0, 1, 0, 0, 0, 0, 0); 35 | test_scalar_classification("abc", "STRING", 0, 1, 0, 0, 0, 0, 0); 36 | test_scalar_classification(123, "STRING", 0, 1, 1, 0, 0, 0, 0); 37 | test_scalar_classification(0, "STRING", 0, 1, 1, 0, 0, 0, 0); 38 | test_scalar_classification("0 but true", "STRING", 0, 1, 1, 0, 0, 0, 0); 39 | test_scalar_classification("1ab", "STRING", 0, 1, 0, 0, 0, 0, 0); 40 | test_scalar_classification(*STDOUT, "GLOB", 0, 0, 0, 1, 0, 0, 0); 41 | SKIP: { skip "no first-class regexps", 2*8 unless "$]" >= 5.011; 42 | test_scalar_classification(${qr/xyz/}, "REGEXP", 0, 0, 0, 0, 1, 0, 0); 43 | } 44 | test_scalar_classification({}, "REF", 0, 0, 0, 0, 0, 1, 0); 45 | test_scalar_classification(bless({}, "main"), "BLESSED", 0, 0, 0, 0, 0, 0, 1); 46 | 47 | 1; 48 | -------------------------------------------------------------------------------- /modules/Params-Classify-0.013/t/classify_pp.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | do "t/setup_pp.pl" or die $@ || $!; 5 | do "t/classify.t" or die $@ || $!; 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /modules/Params-Classify-0.013/t/error_pp.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | do "t/setup_pp.pl" or die $@ || $!; 5 | do "t/error.t" or die $@ || $!; 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /modules/Params-Classify-0.013/t/pod_cvg.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | use Test::More; 5 | plan skip_all => "Test::Pod::Coverage not available" 6 | unless eval "use Test::Pod::Coverage; 1"; 7 | Test::Pod::Coverage::all_pod_coverage_ok(); 8 | 9 | 1; 10 | -------------------------------------------------------------------------------- /modules/Params-Classify-0.013/t/pod_cvg_pp.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | do "t/setup_pp.pl" or die $@ || $!; 5 | do "t/pod_cvg.t" or die $@ || $!; 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /modules/Params-Classify-0.013/t/pod_syn.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | use Test::More; 5 | plan skip_all => "Test::Pod not available" unless eval "use Test::Pod 1.00; 1"; 6 | Test::Pod::all_pod_files_ok(); 7 | 8 | 1; 9 | -------------------------------------------------------------------------------- /modules/Params-Classify-0.013/t/ref.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | use Test::More tests => 1 + 2*14*12; 5 | 6 | BEGIN { use_ok "Params::Classify", qw(is_ref ref_type); } 7 | 8 | format foo = 9 | . 10 | 11 | my $foo = ""; 12 | 13 | sub test_ref_type($$) { 14 | my($scalar, $reftype) = @_; 15 | is(ref_type($scalar), $reftype); 16 | is(&ref_type($scalar), $reftype); 17 | is(!!is_ref($scalar), !!$reftype); 18 | is(!!&is_ref($scalar), !!$reftype); 19 | $reftype = "" if !defined($reftype); 20 | is(!!is_ref($scalar, "SCALAR"), "SCALAR" eq $reftype); 21 | is(!!&is_ref($scalar, "SCALAR"), "SCALAR" eq $reftype); 22 | is(!!is_ref($scalar, "ARRAY"), "ARRAY" eq $reftype); 23 | is(!!&is_ref($scalar, "ARRAY"), "ARRAY" eq $reftype); 24 | is(!!is_ref($scalar, "HASH"), "HASH" eq $reftype); 25 | is(!!&is_ref($scalar, "HASH"), "HASH" eq $reftype); 26 | is(!!is_ref($scalar, "CODE"), "CODE" eq $reftype); 27 | is(!!&is_ref($scalar, "CODE"), "CODE" eq $reftype); 28 | is(!!is_ref($scalar, "FORMAT"), "FORMAT" eq $reftype); 29 | is(!!&is_ref($scalar, "FORMAT"), "FORMAT" eq $reftype); 30 | is(!!is_ref($scalar, "IO"), "IO" eq $reftype); 31 | is(!!&is_ref($scalar, "IO"), "IO" eq $reftype); 32 | foreach my $type (qw(SCALAR ARRAY HASH CODE FORMAT IO)) { 33 | is(!!is_ref($scalar, $type), $type eq $reftype); 34 | is(!!&is_ref($scalar, $type), $type eq $reftype); 35 | } 36 | } 37 | 38 | test_ref_type(undef, undef); 39 | test_ref_type("foo", undef); 40 | test_ref_type(123, undef); 41 | test_ref_type(*STDOUT, undef); 42 | test_ref_type(bless({}, "main"), undef); 43 | 44 | test_ref_type(\1, "SCALAR"); 45 | test_ref_type(\\1, "SCALAR"); 46 | test_ref_type(\pos($foo), "SCALAR"); 47 | test_ref_type([], "ARRAY"); 48 | test_ref_type({}, "HASH"); 49 | test_ref_type(\&is, "CODE"); 50 | 51 | SKIP: { 52 | my $format = *foo{FORMAT}; 53 | skip "this Perl doesn't do *foo{FORMAT}", 2*14 unless defined $format; 54 | test_ref_type($format, "FORMAT"); 55 | } 56 | 57 | 1; 58 | -------------------------------------------------------------------------------- /modules/Params-Classify-0.013/t/ref_pp.t: -------------------------------------------------------------------------------- 1 | use warnings; 2 | use strict; 3 | 4 | do "t/setup_pp.pl" or die $@ || $!; 5 | do "t/ref.t" or die $@ || $!; 6 | 7 | 1; 8 | -------------------------------------------------------------------------------- /modules/Params-Classify-0.013/t/setup_pp.pl: -------------------------------------------------------------------------------- 1 | require XSLoader; 2 | 3 | my $orig_load = \&XSLoader::load; 4 | no warnings "redefine"; 5 | *XSLoader::load = sub { 6 | die "XS loading disabled for Params::Classify" 7 | if ($_[0] || "") eq "Params::Classify"; 8 | goto &$orig_load; 9 | }; 10 | 11 | 1; 12 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/INSTALL: -------------------------------------------------------------------------------- 1 | This is the Perl distribution Params-Validate. 2 | 3 | Installing Params-Validate is straightforward. 4 | 5 | ## Installation with cpanm 6 | 7 | If you have cpanm, you only need one line: 8 | 9 | % cpanm Params::Validate 10 | 11 | If you are installing into a system-wide directory, you may need to pass the 12 | "-S" flag to cpanm, which uses sudo to install the module: 13 | 14 | % cpanm -S Params::Validate 15 | 16 | ## Installing with the CPAN shell 17 | 18 | Alternatively, if your CPAN shell is set up, you should just be able to do: 19 | 20 | % cpan Params::Validate 21 | 22 | ## Manual installation 23 | 24 | As a last resort, you can manually install it. Download the tarball, untar it, 25 | then build it: 26 | 27 | % perl Build.PL 28 | % ./Build && ./Build test 29 | 30 | Then install it: 31 | 32 | % ./Build install 33 | 34 | If you are installing into a system-wide directory, you may need to run: 35 | 36 | % sudo ./Build install 37 | 38 | ## Documentation 39 | 40 | Params-Validate documentation is available as POD. 41 | You can run perldoc from a shell to read the documentation: 42 | 43 | % perldoc Params::Validate 44 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/META.json: -------------------------------------------------------------------------------- 1 | { 2 | "abstract" : "Validate method/function parameters", 3 | "author" : [ 4 | "Dave Rolsky, and Ilya Martynov " 5 | ], 6 | "dynamic_config" : 1, 7 | "generated_by" : "ExtUtils::MakeMaker version 7.1, CPAN::Meta::Converter version 2.150001", 8 | "license" : [ 9 | "artistic_2" 10 | ], 11 | "meta-spec" : { 12 | "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", 13 | "version" : "2" 14 | }, 15 | "name" : "Params-Validate", 16 | "no_index" : { 17 | "directory" : [ 18 | "t", 19 | "inc" 20 | ] 21 | }, 22 | "prereqs" : { 23 | "build" : { 24 | "requires" : { 25 | "Devel::Peek" : "0", 26 | "ExtUtils::MakeMaker" : "0", 27 | "File::Spec" : "0", 28 | "File::Temp" : "0", 29 | "Test::Fatal" : "0", 30 | "Test::More" : "0.96", 31 | "Test::Requires" : "0", 32 | "Tie::Array" : "0", 33 | "Tie::Hash" : "0", 34 | "base" : "0", 35 | "lib" : "0", 36 | "overload" : "0", 37 | "perl" : "5.008001" 38 | } 39 | }, 40 | "configure" : { 41 | "requires" : { 42 | "ExtUtils::MakeMaker" : "0" 43 | } 44 | }, 45 | "runtime" : { 46 | "requires" : { 47 | "Carp" : "0", 48 | "Exporter" : "0", 49 | "JSON::PP" : "2.27300", 50 | "Module::Implementation" : "0", 51 | "Scalar::Util" : "1.10", 52 | "XSLoader" : "0", 53 | "perl" : "5.008001", 54 | "strict" : "0", 55 | "vars" : "0", 56 | "warnings" : "0" 57 | } 58 | } 59 | }, 60 | "release_status" : "stable", 61 | "version" : "1.23" 62 | } 63 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/META.yml: -------------------------------------------------------------------------------- 1 | --- 2 | abstract: 'Validate method/function parameters' 3 | author: 4 | - 'Dave Rolsky, and Ilya Martynov ' 5 | build_requires: 6 | Devel::Peek: '0' 7 | ExtUtils::MakeMaker: '0' 8 | File::Spec: '0' 9 | File::Temp: '0' 10 | Test::Fatal: '0' 11 | Test::More: '0.96' 12 | Test::Requires: '0' 13 | Tie::Array: '0' 14 | Tie::Hash: '0' 15 | base: '0' 16 | lib: '0' 17 | overload: '0' 18 | perl: '5.008001' 19 | configure_requires: 20 | ExtUtils::MakeMaker: '0' 21 | dynamic_config: 1 22 | generated_by: 'ExtUtils::MakeMaker version 7.1, CPAN::Meta::Converter version 2.150001' 23 | license: artistic_2 24 | meta-spec: 25 | url: http://module-build.sourceforge.net/META-spec-v1.4.html 26 | version: '1.4' 27 | name: Params-Validate 28 | no_index: 29 | directory: 30 | - t 31 | - inc 32 | requires: 33 | Carp: '0' 34 | Exporter: '0' 35 | JSON::PP: '2.27300' 36 | Module::Implementation: '0' 37 | Scalar::Util: '1.10' 38 | XSLoader: '0' 39 | perl: '5.008001' 40 | strict: '0' 41 | vars: '0' 42 | warnings: '0' 43 | version: '1.23' 44 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/Makefile.PL: -------------------------------------------------------------------------------- 1 | use strict; 2 | use ExtUtils::MakeMaker 6.64; 3 | use Config; 4 | 5 | my %args = ( 6 | dist => { 7 | PREOP => 'pod2text lib/Params/Validate.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', 8 | COMPRESS => 'gzip -9v', 9 | SUFFIX => '.gz', 10 | }, 11 | NAME => 'Params::Validate', 12 | VERSION_FROM => 'lib/Params/Validate.pm', 13 | ABSTRACT => 'Validate method/function parameters', 14 | AUTHOR => "Dave Rolsky, and Ilya Martynov ", 15 | LICENSE => 'artistic_2', 16 | BUILD_REQUIRES => { 17 | perl => "5.008001", 18 | }, 19 | TEST_REQUIRES => { 20 | "Devel::Peek" => 0, 21 | "ExtUtils::MakeMaker" => 0, 22 | "File::Spec" => 0, 23 | "File::Temp" => 0, 24 | "Test::Fatal" => 0, 25 | "Test::More" => "0.96", 26 | "Test::Requires" => 0, 27 | "Tie::Array" => 0, 28 | "Tie::Hash" => 0, 29 | "base" => 0, 30 | "lib" => 0, 31 | "overload" => 0, 32 | }, 33 | PREREQ_PM => { 34 | "Carp" => 0, 35 | "Exporter" => 0, 36 | "JSON::PP" => "2.27300", 37 | "Module::Implementation" => 0, 38 | "Scalar::Util" => "1.10", 39 | "XSLoader" => 0, 40 | "perl" => "5.008001", 41 | "strict" => 0, 42 | "vars" => 0, 43 | "warnings" => 0, 44 | }, 45 | DIR => [ 'xs' ], 46 | ); 47 | 48 | if ( grep { $_ eq '--pp' } @ARGV ) { 49 | @{ $args{ 'DIR' } } = (); 50 | } 51 | 52 | WriteMakefile( %args ); 53 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/TODO: -------------------------------------------------------------------------------- 1 | - isa/can validation in XS allows this: 2 | 3 | { a => { isa => \%hash } } 4 | 5 | and tries to see if a->isa("HASH(0x1581)"). Instead, we should die if 6 | given a non-array reference. Same for can, etc. See how this is 7 | handled in callbacks for example. 8 | 9 | 10 | - make it possible to explicitly not use the XS version in a non-hacky 11 | way. 12 | 13 | 14 | - is there something better than "N/A" that could be used when 15 | validation is being done outside a sub? 16 | 17 | 18 | - add an excludes param to the spec as the opposite of depends, 19 | suggested by Diab Jerius (see rt.cpan.org). 20 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/lib/Params/Validate/Constants.pm: -------------------------------------------------------------------------------- 1 | package Params::Validate::Constants; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | our $VERSION = '1.23'; 7 | 8 | our @ISA = 'Exporter'; 9 | 10 | our @EXPORT = qw( 11 | SCALAR 12 | ARRAYREF 13 | HASHREF 14 | CODEREF 15 | GLOB 16 | GLOBREF 17 | SCALARREF 18 | HANDLE 19 | BOOLEAN 20 | UNDEF 21 | OBJECT 22 | UNKNOWN 23 | ); 24 | 25 | sub SCALAR () { 1 } 26 | sub ARRAYREF () { 2 } 27 | sub HASHREF () { 4 } 28 | sub CODEREF () { 8 } 29 | sub GLOB () { 16 } 30 | sub GLOBREF () { 32 } 31 | sub SCALARREF () { 64 } 32 | sub UNKNOWN () { 128 } 33 | sub UNDEF () { 256 } 34 | sub OBJECT () { 512 } 35 | 36 | sub HANDLE () { 16 | 32 } 37 | sub BOOLEAN () { 1 | 256 } 38 | 39 | 1; 40 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/lib/Params/Validate/XS.pm: -------------------------------------------------------------------------------- 1 | package Params::Validate::XS; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | our $VERSION = '1.23'; 7 | 8 | use Carp; 9 | 10 | my $default_fail = sub { 11 | Carp::confess( $_[0] ); 12 | }; 13 | 14 | { 15 | my %defaults = ( 16 | ignore_case => 0, 17 | strip_leading => 0, 18 | allow_extra => 0, 19 | on_fail => $default_fail, 20 | stack_skip => 1, 21 | normalize_keys => undef, 22 | ); 23 | 24 | *set_options = \&validation_options; 25 | 26 | sub validation_options { 27 | my %opts = @_; 28 | 29 | my $caller = caller; 30 | 31 | foreach ( keys %defaults ) { 32 | $opts{$_} = $defaults{$_} unless exists $opts{$_}; 33 | } 34 | 35 | $Params::Validate::OPTIONS{$caller} = \%opts; 36 | } 37 | 38 | use XSLoader; 39 | XSLoader::load( 40 | __PACKAGE__, 41 | exists $Params::Validate::XS::{VERSION} 42 | ? ${ $Params::Validate::XS::{VERSION} } 43 | : (), 44 | ); 45 | } 46 | 47 | sub _check_regex_from_xs { 48 | return ( defined $_[0] ? $_[0] : '' ) =~ /$_[1]/ ? 1 : 0; 49 | } 50 | 51 | 1; 52 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/lib/Params/ValidatePP.pm: -------------------------------------------------------------------------------- 1 | package # hide from PAUSE 2 | Params::Validate; 3 | 4 | our $VERSION = '1.23'; 5 | 6 | BEGIN { $ENV{PARAMS_VALIDATE_IMPLEMENTATION} = 'PP' } 7 | use Params::Validate; 8 | 9 | 1; 10 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/lib/Params/ValidateXS.pm: -------------------------------------------------------------------------------- 1 | package # hide from PAUSE 2 | Params::Validate; 3 | 4 | our $VERSION = '1.23'; 5 | 6 | BEGIN { $ENV{PARAMS_VALIDATE_IMPLEMENTATION} = 'XS' } 7 | use Params::Validate; 8 | 9 | 1; 10 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/01-validate.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use File::Spec; 5 | use lib File::Spec->catdir( 't', 'lib' ); 6 | 7 | use PVTests::Standard; 8 | PVTests::Standard::run_tests(); 9 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/02-noop.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use File::Spec; 5 | use lib File::Spec->catdir( 't', 'lib' ); 6 | 7 | BEGIN { $ENV{PERL_NO_VALIDATION} = 1 } 8 | 9 | use PVTests::Standard; 10 | PVTests::Standard::run_tests(); 11 | 12 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/04-defaults.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use File::Spec; 5 | use lib File::Spec->catdir( 't', 'lib' ); 6 | 7 | use PVTests::Defaults; 8 | PVTests::Defaults::run_tests(); 9 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/05-noop_default.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use File::Spec; 5 | use lib File::Spec->catdir( 't', 'lib' ); 6 | 7 | BEGIN { $ENV{PERL_NO_VALIDATION} = 1 } 8 | 9 | use PVTests::Defaults; 10 | PVTests::Defaults::run_tests(); 11 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/06-options.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use File::Spec; 5 | use lib File::Spec->catdir( 't', 'lib' ); 6 | 7 | use PVTests; 8 | use Test::More; 9 | 10 | use Params::Validate qw(:all); 11 | 12 | validation_options( stack_skip => 2 ); 13 | 14 | sub foo { 15 | my %p = validate( @_, { bar => 1 } ); 16 | } 17 | 18 | sub bar { foo(@_) } 19 | 20 | sub baz { bar(@_) } 21 | 22 | eval { baz() }; 23 | 24 | like( $@, qr/mandatory.*missing.*call to main::bar/i ); 25 | 26 | validation_options( stack_skip => 3 ); 27 | 28 | eval { baz() }; 29 | like( $@, qr/mandatory.*missing.*call to main::baz/i ); 30 | 31 | validation_options( on_fail => sub { die bless { hash => 'ref' }, 'Dead' } ); 32 | 33 | eval { baz() }; 34 | 35 | my $e = $@; 36 | is( $e->{hash}, 'ref' ); 37 | ok( eval { $e->isa('Dead'); 1; } ); 38 | 39 | done_testing(); 40 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/07-with.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use File::Spec; 5 | use lib File::Spec->catdir( 't', 'lib' ); 6 | 7 | use PVTests::With; 8 | PVTests::With::run_tests(); 9 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/08-noop_with.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use File::Spec; 5 | use lib File::Spec->catdir( 't', 'lib' ); 6 | 7 | BEGIN { $ENV{PERL_NO_VALIDATION} = 1 } 8 | 9 | use PVTests::With; 10 | PVTests::With::run_tests(); 11 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/09-regex.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use File::Spec; 5 | use lib File::Spec->catdir( 't', 'lib' ); 6 | 7 | use PVTests::Regex; 8 | PVTests::Regex::run_tests(); 9 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/10-noop_regex.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use File::Spec; 5 | use lib File::Spec->catdir( 't', 'lib' ); 6 | 7 | BEGIN { $ENV{PERL_NO_VALIDATION} = 1 } 8 | 9 | use PVTests::Regex; 10 | PVTests::Regex::run_tests(); 11 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/11-cb.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use File::Spec; 5 | use lib File::Spec->catdir( 't', 'lib' ); 6 | 7 | use PVTests::Callbacks; 8 | PVTests::Callbacks::run_tests(); 9 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/12-noop_cb.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use File::Spec; 5 | use lib File::Spec->catdir( 't', 'lib' ); 6 | 7 | BEGIN { $ENV{PERL_NO_VALIDATION} = 1 } 8 | 9 | use PVTests::Callbacks; 10 | PVTests::Callbacks::run_tests(); 11 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/13-taint.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use File::Spec; 5 | use lib File::Spec->catdir( 't', 'lib' ); 6 | 7 | eval { "$0$^X" && kill 0; 1 }; 8 | 9 | use PVTests::Standard; 10 | PVTests::Standard::run_tests(); 11 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/14-no_validate.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use lib './t'; 5 | 6 | use Params::Validate qw(validate); 7 | 8 | use Test::More; 9 | plan tests => $] == 5.006 ? 2 : 3; 10 | 11 | eval { foo() }; 12 | like( $@, qr/parameter 'foo'/ ); 13 | 14 | { 15 | local $Params::Validate::NO_VALIDATION = 1; 16 | 17 | eval { foo() }; 18 | is( $@, q{} ); 19 | } 20 | 21 | unless ( $] == 5.006 ) { 22 | eval { foo() }; 23 | like( $@, qr/parameter 'foo'/ ); 24 | } 25 | 26 | sub foo { 27 | validate( @_, { foo => 1 } ); 28 | } 29 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/16-normalize.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use Params::Validate qw(validate validate_with); 5 | use Test::More; 6 | 7 | my $ucfirst_normalizer = sub { return ucfirst lc $_[0] }; 8 | 9 | sub sub1 { 10 | my %args = validate_with( 11 | params => \@_, 12 | spec => { PaRaMkEy => 1 }, 13 | normalize_keys => $ucfirst_normalizer 14 | ); 15 | 16 | return $args{Paramkey}; 17 | } 18 | 19 | sub sub2 { 20 | 21 | # verify that normalize_callback surpresses ignore_case 22 | my %args = validate_with( 23 | params => \@_, 24 | spec => { PaRaMkEy => 1 }, 25 | normalize_keys => $ucfirst_normalizer, 26 | ignore_case => 1 27 | ); 28 | 29 | return $args{Paramkey}; 30 | } 31 | 32 | sub sub3 { 33 | 34 | # verify that normalize_callback surpresses strip_leading 35 | my %args = validate_with( 36 | params => \@_, 37 | spec => { -PaRaMkEy => 1 }, 38 | normalize_keys => $ucfirst_normalizer, 39 | strip_leading => '-' 40 | ); 41 | 42 | return $args{-paramkey}; 43 | } 44 | 45 | sub sub4 { 46 | my %args = validate_with( 47 | params => \@_, 48 | spec => { foo => 1 }, 49 | normalize_keys => sub {undef} 50 | ); 51 | } 52 | 53 | sub sub5 { 54 | my %args = validate_with( 55 | params => \@_, 56 | spec => { foo => 1 }, 57 | normalize_keys => sub { return 'a' }, 58 | ); 59 | } 60 | 61 | ok( eval { sub1( pArAmKeY => 1 ) } ); 62 | ok( eval { sub2( pArAmKeY => 1 ) } ); 63 | ok( eval { sub3( -pArAmKeY => 1 ) } ); 64 | 65 | eval { sub4( foo => 5 ) }; 66 | like( $@, qr/normalize_keys.+a defined value/ ); 67 | 68 | eval { sub5( foo => 5, bar => 5 ) }; 69 | like( $@, qr/normalize_keys.+already exists/ ); 70 | 71 | done_testing(); 72 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/17-callbacks.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use Params::Validate qw(validate validate_pos SCALAR); 5 | use Test::More; 6 | 7 | { 8 | my @p = ( foo => 1, bar => 2 ); 9 | 10 | eval { 11 | validate( 12 | @p, { 13 | foo => { 14 | type => SCALAR, 15 | callbacks => { 16 | 'bigger than bar' => sub { $_[0] > $_[1]->{bar} } 17 | }, 18 | }, 19 | bar => { type => SCALAR }, 20 | } 21 | ); 22 | }; 23 | 24 | like( $@, qr/bigger than bar/ ); 25 | 26 | $p[1] = 3; 27 | eval { 28 | validate( 29 | @p, { 30 | foo => { 31 | type => SCALAR, 32 | callbacks => { 33 | 'bigger than bar' => sub { $_[0] > $_[1]->{bar} } 34 | }, 35 | }, 36 | bar => { type => SCALAR }, 37 | } 38 | ); 39 | }; 40 | 41 | is( $@, q{} ); 42 | } 43 | 44 | { 45 | my @p = ( 1, 2, 3 ); 46 | eval { 47 | validate_pos( 48 | @p, { 49 | type => SCALAR, 50 | callbacks => { 51 | 'bigger than [1]' => sub { $_[0] > $_[1]->[1] } 52 | } 53 | }, 54 | { type => SCALAR }, 55 | { type => SCALAR }, 56 | ); 57 | }; 58 | 59 | like( $@, qr/bigger than \[1\]/ ); 60 | 61 | $p[0] = 5; 62 | eval { 63 | validate_pos( 64 | @p, { 65 | type => SCALAR, 66 | callbacks => { 67 | 'bigger than [1]' => sub { $_[0] > $_[1]->[1] } 68 | } 69 | }, 70 | { type => SCALAR }, 71 | { type => SCALAR }, 72 | ); 73 | }; 74 | 75 | is( $@, q{} ); 76 | } 77 | 78 | done_testing(); 79 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/22-overload-can-bug.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use Params::Validate qw(validate); 5 | use Test::More; 6 | 7 | { 8 | package Overloaded; 9 | 10 | use overload 'bool' => sub {0}; 11 | 12 | sub new { bless {} } 13 | 14 | sub foo {1} 15 | } 16 | 17 | my $ovl = Overloaded->new; 18 | 19 | { 20 | eval { 21 | my @p = ( object => $ovl ); 22 | validate( @p, { object => { isa => 'Overloaded' } } ); 23 | }; 24 | 25 | is( $@, q{}, 'overloaded object->isa' ); 26 | } 27 | 28 | { 29 | eval { 30 | my @p = ( object => $ovl ); 31 | validate( @p, { object => { can => 'foo' } } ); 32 | }; 33 | 34 | is( $@, q{}, 'overloaded object->foo' ); 35 | } 36 | 37 | done_testing(); 38 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/23-readonly.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use Test::Requires { 5 | Readonly => '1.03', 6 | 'Scalar::Util' => '1.20', 7 | }; 8 | 9 | use Params::Validate qw(validate validate_pos SCALAR); 10 | use Test::More; 11 | 12 | plan skip_all => 'These tests fail with Readonly 1.50 for some reason' 13 | if Readonly::->VERSION() =~ /^v?1.5/; 14 | 15 | { 16 | Readonly my $spec => { foo => 1 }; 17 | my @p = ( foo => 'hello' ); 18 | 19 | eval { validate( @p, $spec ) }; 20 | is( $@, q{}, 'validate() call succeeded with Readonly spec hashref' ); 21 | } 22 | 23 | { 24 | Readonly my $spec => { type => SCALAR }; 25 | my @p = 'hello'; 26 | 27 | eval { validate_pos( @p, $spec ) }; 28 | is( $@, q{}, 'validate_pos() call succeeded with Readonly spec hashref' ); 29 | } 30 | 31 | { 32 | Readonly my %spec => ( foo => { type => SCALAR } ); 33 | my @p = ( foo => 'hello' ); 34 | 35 | eval { validate( @p, \%spec ) }; 36 | is( $@, q{}, 'validate() call succeeded with Readonly spec hash' ); 37 | } 38 | 39 | done_testing(); 40 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/25-undef-regex.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use Params::Validate qw(validate); 5 | use Test::More; 6 | 7 | { 8 | my @w; 9 | local $SIG{__WARN__} = sub { push @w, @_ }; 10 | 11 | my @p = ( foo => undef ); 12 | eval { validate( @p, { foo => { regex => qr/^bar/ } } ) }; 13 | ok( $@, 'validation failed' ); 14 | ok( !@w, 'no warnings' ); 15 | } 16 | 17 | done_testing(); 18 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/27-string-as-type.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use Params::Validate qw(validate); 5 | use Test::More; 6 | 7 | { 8 | my @p = ( foo => 1 ); 9 | 10 | eval { validate( @p, { foo => { type => 'SCALAR' } }, ); }; 11 | 12 | like( 13 | $@, 14 | qr/\QThe 'foo' parameter ("1") has a type specification which is not a number. It is a string - SCALAR/ 15 | ); 16 | } 17 | 18 | { 19 | my @p = ( foo => 1 ); 20 | 21 | eval { validate( @p, { foo => { type => undef } }, ); }; 22 | 23 | like( 24 | $@, 25 | qr/\QThe 'foo' parameter ("1") has a type specification which is not a number. It is undef/ 26 | ); 27 | 28 | } 29 | 30 | done_testing(); 31 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/28-readonly-return.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | use Test::More; 4 | 5 | use Devel::Peek qw( SvREFCNT ); 6 | use File::Temp qw( tempfile ); 7 | use Params::Validate qw( validate SCALAR HANDLE ); 8 | 9 | { 10 | my $fh = tempfile(); 11 | my @p = ( 12 | foo => 1, 13 | bar => $fh, 14 | ); 15 | 16 | my $ref = val1(@p); 17 | 18 | eval { $ref->{foo} = 2 }; 19 | ok( !$@, 'returned hashref values are not read only' ); 20 | is( $ref->{foo}, 2, 'double check that setting value worked' ); 21 | is( $fh, $ref->{bar}, 'filehandle is not copied during validation' ); 22 | } 23 | 24 | { 25 | 26 | package ScopeTest; 27 | 28 | my $live = 0; 29 | 30 | sub new { $live++; bless {}, shift } 31 | sub DESTROY { $live-- } 32 | 33 | sub Live {$live} 34 | } 35 | 36 | { 37 | my @p = ( foo => ScopeTest->new() ); 38 | 39 | is( 40 | ScopeTest->Live(), 1, 41 | 'one live object' 42 | ); 43 | 44 | my $ref = val2(@p); 45 | 46 | isa_ok( $ref->{foo}, 'ScopeTest' ); 47 | 48 | @p = (); 49 | 50 | is( 51 | ScopeTest->Live(), 1, 52 | 'still one live object' 53 | ); 54 | 55 | ok( 56 | defined $ref->{foo}, 57 | 'foo key stays in scope after original version goes out of scope' 58 | ); 59 | is( 60 | SvREFCNT( $ref->{foo} ), 1, 61 | 'ref count for reference is 1' 62 | ); 63 | 64 | undef $ref->{foo}; 65 | 66 | is( 67 | ScopeTest->Live(), 0, 68 | 'no live objects' 69 | ); 70 | } 71 | 72 | sub val1 { 73 | my $ref = validate( 74 | @_, { 75 | foo => { type => SCALAR }, 76 | bar => { type => HANDLE, optional => 1 }, 77 | }, 78 | ); 79 | 80 | return $ref; 81 | } 82 | 83 | sub val2 { 84 | my $ref = validate( 85 | @_, { 86 | foo => 1, 87 | }, 88 | ); 89 | 90 | return $ref; 91 | } 92 | 93 | done_testing(); 94 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/29-taint-mode.t: -------------------------------------------------------------------------------- 1 | #!perl -T 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Test::Requires { 7 | 'Test::Taint' => 0.02, 8 | }; 9 | 10 | use Test::Fatal; 11 | use Test::More; 12 | 13 | use Params::Validate qw( validate validate_pos ARRAYREF ); 14 | 15 | taint_checking_ok('These tests are meaningless unless we are in taint mode.'); 16 | 17 | sub test1 { 18 | my $def = $0; 19 | tainted_ok( $def, 'make sure $def is tainted' ); 20 | 21 | # The spec is irrelevant, all that matters is that there's a 22 | # tainted scalar as the default 23 | my %p = validate( @_, { foo => { default => $def } } ); 24 | } 25 | 26 | { 27 | is( 28 | exception { test1() }, 29 | undef, 30 | 'no taint error when we validate with tainted default value' 31 | ); 32 | } 33 | 34 | sub test2 { 35 | return validate_pos( @_, { regex => qr/^b/ } ); 36 | } 37 | 38 | SKIP: 39 | { 40 | skip 'This test only passes on Perl 5.14+', 1 41 | unless $] >= 5.014; 42 | 43 | my @p = 'cat'; 44 | taint(@p); 45 | 46 | like( 47 | exception { test2(@p) }, 48 | qr/\QParameter #1 ("cat") to main::test2 did not pass regex check/, 49 | 'no taint error when we validate with tainted value values being validated' 50 | ); 51 | } 52 | 53 | done_testing(); 54 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/30-hashref-alteration.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | use Test::More; 4 | 5 | use Params::Validate qw( validate SCALAR ); 6 | 7 | { 8 | my $p = { foo => 1 }; 9 | 10 | val($p); 11 | 12 | is_deeply( 13 | $p, { foo => 1 }, 14 | 'validate does not alter hashref passed to val' 15 | ); 16 | 17 | val2($p); 18 | 19 | is_deeply( 20 | $p, { foo => 1 }, 21 | 'validate does not alter hashref passed to val, even with defaults being supplied' 22 | ); 23 | } 24 | 25 | sub val { 26 | validate( 27 | @_, { 28 | foo => { optional => 1 }, 29 | bar => { optional => 1 }, 30 | baz => { optional => 1 }, 31 | buz => { optional => 1 }, 32 | }, 33 | ); 34 | 35 | return; 36 | } 37 | 38 | sub val2 { 39 | validate( 40 | @_, { 41 | foo => { optional => 1 }, 42 | bar => { default => 42 }, 43 | baz => { optional => 1 }, 44 | buz => { optional => 1 }, 45 | }, 46 | ); 47 | 48 | return; 49 | } 50 | 51 | done_testing(); 52 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/31-incorrect-spelling.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Test::More; 7 | 8 | use Params::Validate qw( validate validate_pos SCALAR ); 9 | 10 | plan skip_all => 'Spec validation is disabled for now'; 11 | 12 | { 13 | my @p = ( foo => 1, bar => 2 ); 14 | 15 | eval { 16 | validate( 17 | @p, { 18 | foo => { 19 | type => SCALAR, 20 | callbucks => { 21 | 'one' => sub {1} 22 | }, 23 | }, 24 | bar => { type => SCALAR }, 25 | } 26 | ); 27 | }; 28 | 29 | like( $@, qr/is not an allowed validation spec key/ ); 30 | 31 | eval { 32 | validate( 33 | @p, { 34 | foo => { 35 | hype => SCALAR, 36 | callbacks => { 37 | 'one' => sub {1} 38 | }, 39 | }, 40 | bar => { type => SCALAR }, 41 | } 42 | ); 43 | }; 44 | 45 | like( $@, qr/is not an allowed validation spec key/ ); 46 | eval { 47 | validate( 48 | @p, { 49 | foo => { 50 | type => SCALAR, 51 | regexp => qr/^\d+$/, 52 | }, 53 | bar => { type => SCALAR }, 54 | } 55 | ); 56 | }; 57 | 58 | like( $@, qr/is not an allowed validation spec key/ ); 59 | } 60 | 61 | done_testing(); 62 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/32-regex-as-value.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use Params::Validate qw( validate SCALAR SCALARREF ); 5 | 6 | use Test::More; 7 | use Test::Fatal; 8 | 9 | is( 10 | exception { v( foo => qr/foo/ ) }, 11 | undef, 12 | 'no exception with regex object' 13 | ); 14 | 15 | is( 16 | exception { v( foo => 'foo' ) }, 17 | undef, 18 | 'no exception with plain scalar' 19 | ); 20 | 21 | my $foo = 'foo'; 22 | is( 23 | exception { v( foo => \$foo ) }, 24 | undef, 25 | 'no exception with scalar ref' 26 | ); 27 | 28 | done_testing(); 29 | 30 | sub v { 31 | validate( 32 | @_, { 33 | foo => { type => SCALAR | SCALARREF }, 34 | }, 35 | ); 36 | return; 37 | } 38 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/33-keep-errsv.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use Params::Validate qw( validate SCALAR ); 5 | 6 | use Test::More; 7 | 8 | { 9 | $@ = 'foo'; 10 | v( bar => 42 ); 11 | 12 | is( 13 | $@, 14 | 'foo', 15 | 'calling validate() does not clobber' 16 | ); 17 | } 18 | 19 | done_testing(); 20 | 21 | sub v { 22 | validate( @_, { bar => { type => SCALAR } } ); 23 | } 24 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/34-recursive-validation.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use Test::Fatal; 5 | use Test::More; 6 | 7 | { 8 | package Foo; 9 | 10 | use Params::Validate qw( validate SCALAR ); 11 | 12 | Params::Validate::validation_options( allow_extra => 1 ); 13 | 14 | sub test_foo { 15 | my %p = validate( @_, { arg1 => { type => SCALAR } } ); 16 | print "test foo\n"; 17 | } 18 | } 19 | 20 | { 21 | package Bar; 22 | 23 | use Params::Validate qw( validate SCALAR ); 24 | Params::Validate::validation_options( allow_extra => 0 ); 25 | 26 | sub test_bar { 27 | 28 | # catch die signal 29 | local $SIG{__DIE__} = sub { 30 | 31 | # we died from within Params::Validate (because of wrong_Arg) we 32 | # call Foo::test_foo with OK args, but it'll die, because 33 | # Params::Validate::PP::options is still set to the options of the 34 | # Bar package, and so it won't retreive the one from Foo. 35 | Foo::test_foo( arg1 => 1, extra_arg => 2 ); 36 | }; 37 | 38 | # this will die because the arg received is 'wrong_arg' 39 | my %p = validate( @_, { arg1 => { type => SCALAR } } ); 40 | } 41 | } 42 | 43 | { 44 | # This bug only manifests with the pure Perl code because of its use of local 45 | # to remember the per-package options. 46 | local $TODO = 'Not sure how to fix this one'; 47 | unlike( 48 | exception { Bar::test_bar( bad_arg => 2 ) }, 49 | qr/was passed in the call to Foo::test_foo/, 50 | 'no exception from Foo::test_foo when when calling validate() from within a __DIE__ handler' 51 | ); 52 | } 53 | 54 | done_testing(); 55 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/35-default-xs-bug.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use Test::More 0.88; 5 | 6 | use Params::Validate qw( :all ); 7 | 8 | default_test(); 9 | 10 | done_testing(); 11 | 12 | sub default_test { 13 | my ( $first, $second ) = validate_pos( 14 | @_, 15 | { type => SCALAR, optional => 1 }, 16 | { type => SCALAR, optional => 1, default => 'must be second one' }, 17 | ); 18 | 19 | is( $first, undef, 'no default for first parameter' ); 20 | is( $second, 'must be second one', 21 | 'default for second parameter is applied' ); 22 | } 23 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/36-large-arrays.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use Test::Fatal; 5 | use Test::More; 6 | 7 | { 8 | package Foo; 9 | 10 | use Params::Validate qw( validate ARRAYREF ); 11 | 12 | sub v1 { 13 | my %p = validate( 14 | @_, { 15 | array => { 16 | callbacks => { 17 | 'checking array contents' => sub { 18 | for my $x ( @{ $_[0] } ) { 19 | return 0 unless defined $x && !ref $x; 20 | } 21 | return 1; 22 | }, 23 | } 24 | } 25 | } 26 | ); 27 | return $p{array}; 28 | } 29 | } 30 | 31 | { 32 | for my $size ( 100, 1_000, 100_000 ) { 33 | my @array = ('x') x $size; 34 | is_deeply( 35 | Foo::v1( array => \@array ), 36 | \@array, 37 | "validate() handles $size element array correctly" 38 | ); 39 | } 40 | } 41 | 42 | done_testing(); 43 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/37-exports.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use Test::More; 5 | use Params::Validate (); 6 | 7 | my @types = qw( 8 | SCALAR 9 | ARRAYREF 10 | HASHREF 11 | CODEREF 12 | GLOB 13 | GLOBREF 14 | SCALARREF 15 | HANDLE 16 | BOOLEAN 17 | UNDEF 18 | OBJECT 19 | ); 20 | 21 | my @subs = qw( 22 | validate 23 | validate_pos 24 | validation_options 25 | validate_with 26 | ); 27 | 28 | is_deeply( 29 | [ sort @Params::Validate::EXPORT_OK ], 30 | [ sort @types, @subs, 'set_options' ], 31 | '@EXPORT_OK' 32 | ); 33 | 34 | is_deeply( 35 | [ sort keys %Params::Validate::EXPORT_TAGS ], 36 | [qw( all types )], 37 | 'keys %EXPORT_TAGS' 38 | ); 39 | 40 | is_deeply( 41 | [ sort @{ $Params::Validate::EXPORT_TAGS{all} } ], 42 | [ sort @types, @subs ], 43 | '$EXPORT_TAGS{all}', 44 | ); 45 | 46 | is_deeply( 47 | [ sort @{ $Params::Validate::EXPORT_TAGS{types} } ], 48 | [ sort @types ], 49 | '$EXPORT_TAGS{types}', 50 | ); 51 | 52 | done_testing(); 53 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/39-reentrant.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use Params::Validate qw( validate SCALAR ); 5 | use Test::More; 6 | 7 | for my $i ( 1 .. 1000 ) { 8 | ok( bar(), 'bar()' ); 9 | is( foo( foo => $i ), $i, "reentrant validation works ($i)" ); 10 | } 11 | 12 | done_testing(); 13 | 14 | sub foo { 15 | my %p = validate( 16 | @_, 17 | { 18 | foo => { 19 | callbacks => { 20 | 'call bar' => sub { bar() } 21 | }, 22 | }, 23 | }, 24 | ); 25 | 26 | return $p{foo}; 27 | } 28 | 29 | sub bar { 30 | my %p = baz( baz => 42 ); 31 | 32 | return $p{baz} == 42; 33 | } 34 | 35 | sub baz { 36 | my %p = validate( 37 | @_, 38 | { 39 | baz => { 40 | type => SCALAR, 41 | callbacks => { 42 | 'is num' => sub { $_[0] =~ /^\d+$/ }, 43 | }, 44 | }, 45 | }, 46 | ); 47 | 48 | return %p; 49 | } 50 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-00-compile.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | use 5.006; 10 | use strict; 11 | use warnings; 12 | 13 | # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.054 14 | 15 | use Test::More; 16 | 17 | plan tests => 7; 18 | 19 | my @module_files = ( 20 | 'Params/Validate.pm', 21 | 'Params/Validate/Constants.pm', 22 | 'Params/Validate/PP.pm', 23 | 'Params/Validate/XS.pm', 24 | 'Params/ValidatePP.pm', 25 | 'Params/ValidateXS.pm' 26 | ); 27 | 28 | 29 | 30 | # no fake home requested 31 | 32 | my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib'; 33 | 34 | use File::Spec; 35 | use IPC::Open3; 36 | use IO::Handle; 37 | 38 | open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; 39 | 40 | my @warnings; 41 | for my $lib (@module_files) 42 | { 43 | # see L 44 | my $stderr = IO::Handle->new; 45 | 46 | my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]"); 47 | binmode $stderr, ':crlf' if $^O eq 'MSWin32'; 48 | my @_warnings = <$stderr>; 49 | waitpid($pid, 0); 50 | is($?, 0, "$lib loaded ok"); 51 | 52 | shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ 53 | and not eval { require blib; blib->VERSION('1.01') }; 54 | 55 | if (@_warnings) 56 | { 57 | warn @_warnings; 58 | push @warnings, @_warnings; 59 | } 60 | } 61 | 62 | 63 | 64 | is(scalar(@warnings), 0, 'no warnings found') 65 | or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ); 66 | 67 | 68 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-mojibake.t: -------------------------------------------------------------------------------- 1 | #!perl 2 | 3 | BEGIN { 4 | unless ($ENV{AUTHOR_TESTING}) { 5 | require Test::More; 6 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 7 | } 8 | } 9 | 10 | 11 | use strict; 12 | use warnings qw(all); 13 | 14 | use Test::More; 15 | use Test::Mojibake; 16 | 17 | all_files_encoding_ok(); 18 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pod-spell.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | use strict; 10 | use warnings; 11 | use Test::More; 12 | 13 | # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007000 14 | use Test::Spelling 0.12; 15 | use Pod::Wordlist; 16 | 17 | 18 | add_stopwords(); 19 | all_pod_files_spelling_ok( qw( bin lib ) ); 20 | __DATA__ 21 | drolsky 22 | DROLSKY 23 | DROLSKY's 24 | PayPal 25 | Rolsky 26 | Rolsky's 27 | API 28 | CPAN 29 | GLOBREF 30 | OO 31 | SCALARREF 32 | ValidatePos 33 | baz 34 | onwards 35 | pre 36 | runtime 37 | Dave 38 | autarch 39 | Ilya 40 | Martynov 41 | ilya 42 | and 43 | Ivan 44 | Bessarabov 45 | ivan 46 | Mash 47 | jmash 48 | Noel 49 | Maddy 50 | zhtwnpanta 51 | Olivier 52 | Mengué 53 | dolmen 54 | Tony 55 | Cook 56 | tony 57 | Vincent 58 | Pit 59 | perl 60 | lib 61 | Params 62 | Validate 63 | Constants 64 | PP 65 | XS 66 | ValidatePP 67 | ValidateXS 68 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pod-syntax.t: -------------------------------------------------------------------------------- 1 | #!perl 2 | 3 | BEGIN { 4 | unless ($ENV{AUTHOR_TESTING}) { 5 | require Test::More; 6 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 7 | } 8 | } 9 | 10 | # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. 11 | use strict; use warnings; 12 | use Test::More; 13 | use Test::Pod 1.41; 14 | 15 | all_pod_files_ok(); 16 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-01-validate.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use File::Spec; 17 | use lib File::Spec->catdir( 't', 'lib' ); 18 | 19 | use PVTests::Standard; 20 | PVTests::Standard::run_tests(); 21 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-02-noop.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use File::Spec; 17 | use lib File::Spec->catdir( 't', 'lib' ); 18 | 19 | BEGIN { $ENV{PERL_NO_VALIDATION} = 1 } 20 | 21 | use PVTests::Standard; 22 | PVTests::Standard::run_tests(); 23 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-04-defaults.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use File::Spec; 17 | use lib File::Spec->catdir( 't', 'lib' ); 18 | 19 | use PVTests::Defaults; 20 | PVTests::Defaults::run_tests(); 21 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-05-noop_default.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use File::Spec; 17 | use lib File::Spec->catdir( 't', 'lib' ); 18 | 19 | BEGIN { $ENV{PERL_NO_VALIDATION} = 1 } 20 | 21 | use PVTests::Defaults; 22 | PVTests::Defaults::run_tests(); 23 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-06-options.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use File::Spec; 17 | use lib File::Spec->catdir( 't', 'lib' ); 18 | 19 | use PVTests; 20 | use Test::More; 21 | 22 | use Params::Validate qw(:all); 23 | 24 | validation_options( stack_skip => 2 ); 25 | 26 | sub foo { 27 | my %p = validate( @_, { bar => 1 } ); 28 | } 29 | 30 | sub bar { foo(@_) } 31 | 32 | sub baz { bar(@_) } 33 | 34 | eval { baz() }; 35 | 36 | like( $@, qr/mandatory.*missing.*call to main::bar/i ); 37 | 38 | validation_options( stack_skip => 3 ); 39 | 40 | eval { baz() }; 41 | like( $@, qr/mandatory.*missing.*call to main::baz/i ); 42 | 43 | validation_options( on_fail => sub { die bless { hash => 'ref' }, 'Dead' } ); 44 | 45 | eval { baz() }; 46 | 47 | my $e = $@; 48 | is( $e->{hash}, 'ref' ); 49 | ok( eval { $e->isa('Dead'); 1; } ); 50 | 51 | done_testing(); 52 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-07-with.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use File::Spec; 17 | use lib File::Spec->catdir( 't', 'lib' ); 18 | 19 | use PVTests::With; 20 | PVTests::With::run_tests(); 21 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-08-noop_with.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use File::Spec; 17 | use lib File::Spec->catdir( 't', 'lib' ); 18 | 19 | BEGIN { $ENV{PERL_NO_VALIDATION} = 1 } 20 | 21 | use PVTests::With; 22 | PVTests::With::run_tests(); 23 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-09-regex.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use File::Spec; 17 | use lib File::Spec->catdir( 't', 'lib' ); 18 | 19 | use PVTests::Regex; 20 | PVTests::Regex::run_tests(); 21 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-10-noop_regex.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use File::Spec; 17 | use lib File::Spec->catdir( 't', 'lib' ); 18 | 19 | BEGIN { $ENV{PERL_NO_VALIDATION} = 1 } 20 | 21 | use PVTests::Regex; 22 | PVTests::Regex::run_tests(); 23 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-11-cb.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use File::Spec; 17 | use lib File::Spec->catdir( 't', 'lib' ); 18 | 19 | use PVTests::Callbacks; 20 | PVTests::Callbacks::run_tests(); 21 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-12-noop_cb.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use File::Spec; 17 | use lib File::Spec->catdir( 't', 'lib' ); 18 | 19 | BEGIN { $ENV{PERL_NO_VALIDATION} = 1 } 20 | 21 | use PVTests::Callbacks; 22 | PVTests::Callbacks::run_tests(); 23 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-13-taint.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use File::Spec; 17 | use lib File::Spec->catdir( 't', 'lib' ); 18 | 19 | eval { "$0$^X" && kill 0; 1 }; 20 | 21 | use PVTests::Standard; 22 | PVTests::Standard::run_tests(); 23 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-14-no_validate.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use lib './t'; 17 | 18 | use Params::Validate qw(validate); 19 | 20 | use Test::More; 21 | plan tests => $] == 5.006 ? 2 : 3; 22 | 23 | eval { foo() }; 24 | like( $@, qr/parameter 'foo'/ ); 25 | 26 | { 27 | local $Params::Validate::NO_VALIDATION = 1; 28 | 29 | eval { foo() }; 30 | is( $@, q{} ); 31 | } 32 | 33 | unless ( $] == 5.006 ) { 34 | eval { foo() }; 35 | like( $@, qr/parameter 'foo'/ ); 36 | } 37 | 38 | sub foo { 39 | validate( @_, { foo => 1 } ); 40 | } 41 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-22-overload-can-bug.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use Params::Validate qw(validate); 17 | use Test::More; 18 | 19 | { 20 | package Overloaded; 21 | 22 | use overload 'bool' => sub {0}; 23 | 24 | sub new { bless {} } 25 | 26 | sub foo {1} 27 | } 28 | 29 | my $ovl = Overloaded->new; 30 | 31 | { 32 | eval { 33 | my @p = ( object => $ovl ); 34 | validate( @p, { object => { isa => 'Overloaded' } } ); 35 | }; 36 | 37 | is( $@, q{}, 'overloaded object->isa' ); 38 | } 39 | 40 | { 41 | eval { 42 | my @p = ( object => $ovl ); 43 | validate( @p, { object => { can => 'foo' } } ); 44 | }; 45 | 46 | is( $@, q{}, 'overloaded object->foo' ); 47 | } 48 | 49 | done_testing(); 50 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-23-readonly.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use Test::Requires { 17 | Readonly => '1.03', 18 | 'Scalar::Util' => '1.20', 19 | }; 20 | 21 | use Params::Validate qw(validate validate_pos SCALAR); 22 | use Test::More; 23 | 24 | plan skip_all => 'These tests fail with Readonly 1.50 for some reason' 25 | if Readonly::->VERSION() =~ /^v?1.5/; 26 | 27 | { 28 | Readonly my $spec => { foo => 1 }; 29 | my @p = ( foo => 'hello' ); 30 | 31 | eval { validate( @p, $spec ) }; 32 | is( $@, q{}, 'validate() call succeeded with Readonly spec hashref' ); 33 | } 34 | 35 | { 36 | Readonly my $spec => { type => SCALAR }; 37 | my @p = 'hello'; 38 | 39 | eval { validate_pos( @p, $spec ) }; 40 | is( $@, q{}, 'validate_pos() call succeeded with Readonly spec hashref' ); 41 | } 42 | 43 | { 44 | Readonly my %spec => ( foo => { type => SCALAR } ); 45 | my @p = ( foo => 'hello' ); 46 | 47 | eval { validate( @p, \%spec ) }; 48 | is( $@, q{}, 'validate() call succeeded with Readonly spec hash' ); 49 | } 50 | 51 | done_testing(); 52 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-25-undef-regex.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use Params::Validate qw(validate); 17 | use Test::More; 18 | 19 | { 20 | my @w; 21 | local $SIG{__WARN__} = sub { push @w, @_ }; 22 | 23 | my @p = ( foo => undef ); 24 | eval { validate( @p, { foo => { regex => qr/^bar/ } } ) }; 25 | ok( $@, 'validation failed' ); 26 | ok( !@w, 'no warnings' ); 27 | } 28 | 29 | done_testing(); 30 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-27-string-as-type.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use Params::Validate qw(validate); 17 | use Test::More; 18 | 19 | { 20 | my @p = ( foo => 1 ); 21 | 22 | eval { validate( @p, { foo => { type => 'SCALAR' } }, ); }; 23 | 24 | like( 25 | $@, 26 | qr/\QThe 'foo' parameter ("1") has a type specification which is not a number. It is a string - SCALAR/ 27 | ); 28 | } 29 | 30 | { 31 | my @p = ( foo => 1 ); 32 | 33 | eval { validate( @p, { foo => { type => undef } }, ); }; 34 | 35 | like( 36 | $@, 37 | qr/\QThe 'foo' parameter ("1") has a type specification which is not a number. It is undef/ 38 | ); 39 | 40 | } 41 | 42 | done_testing(); 43 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-29-taint-mode.t: -------------------------------------------------------------------------------- 1 | #!perl -T 2 | 3 | BEGIN { 4 | unless ($ENV{AUTHOR_TESTING}) { 5 | require Test::More; 6 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 7 | } 8 | } 9 | 10 | 11 | BEGIN { 12 | $ENV{PV_TEST_PERL} = 1; 13 | } 14 | 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::Requires { 20 | 'Test::Taint' => 0.02, 21 | }; 22 | 23 | use Test::Fatal; 24 | use Test::More; 25 | 26 | use Params::Validate qw( validate validate_pos ARRAYREF ); 27 | 28 | taint_checking_ok('These tests are meaningless unless we are in taint mode.'); 29 | 30 | sub test1 { 31 | my $def = $0; 32 | tainted_ok( $def, 'make sure $def is tainted' ); 33 | 34 | # The spec is irrelevant, all that matters is that there's a 35 | # tainted scalar as the default 36 | my %p = validate( @_, { foo => { default => $def } } ); 37 | } 38 | 39 | { 40 | is( 41 | exception { test1() }, 42 | undef, 43 | 'no taint error when we validate with tainted default value' 44 | ); 45 | } 46 | 47 | sub test2 { 48 | return validate_pos( @_, { regex => qr/^b/ } ); 49 | } 50 | 51 | SKIP: 52 | { 53 | skip 'This test only passes on Perl 5.14+', 1 54 | unless $] >= 5.014; 55 | 56 | my @p = 'cat'; 57 | taint(@p); 58 | 59 | like( 60 | exception { test2(@p) }, 61 | qr/\QParameter #1 ("cat") to main::test2 did not pass regex check/, 62 | 'no taint error when we validate with tainted value values being validated' 63 | ); 64 | } 65 | 66 | done_testing(); 67 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-30-hashref-alteration.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | use Test::More; 16 | 17 | use Params::Validate qw( validate SCALAR ); 18 | 19 | { 20 | my $p = { foo => 1 }; 21 | 22 | val($p); 23 | 24 | is_deeply( 25 | $p, { foo => 1 }, 26 | 'validate does not alter hashref passed to val' 27 | ); 28 | 29 | val2($p); 30 | 31 | is_deeply( 32 | $p, { foo => 1 }, 33 | 'validate does not alter hashref passed to val, even with defaults being supplied' 34 | ); 35 | } 36 | 37 | sub val { 38 | validate( 39 | @_, { 40 | foo => { optional => 1 }, 41 | bar => { optional => 1 }, 42 | baz => { optional => 1 }, 43 | buz => { optional => 1 }, 44 | }, 45 | ); 46 | 47 | return; 48 | } 49 | 50 | sub val2 { 51 | validate( 52 | @_, { 53 | foo => { optional => 1 }, 54 | bar => { default => 42 }, 55 | baz => { optional => 1 }, 56 | buz => { optional => 1 }, 57 | }, 58 | ); 59 | 60 | return; 61 | } 62 | 63 | done_testing(); 64 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-31-incorrect-spelling.t: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | BEGIN { 4 | unless ($ENV{AUTHOR_TESTING}) { 5 | require Test::More; 6 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 7 | } 8 | } 9 | 10 | 11 | BEGIN { 12 | $ENV{PV_TEST_PERL} = 1; 13 | } 14 | 15 | 16 | use strict; 17 | use warnings; 18 | 19 | use Test::More; 20 | 21 | use Params::Validate qw( validate validate_pos SCALAR ); 22 | 23 | plan skip_all => 'Spec validation is disabled for now'; 24 | 25 | { 26 | my @p = ( foo => 1, bar => 2 ); 27 | 28 | eval { 29 | validate( 30 | @p, { 31 | foo => { 32 | type => SCALAR, 33 | callbucks => { 34 | 'one' => sub {1} 35 | }, 36 | }, 37 | bar => { type => SCALAR }, 38 | } 39 | ); 40 | }; 41 | 42 | like( $@, qr/is not an allowed validation spec key/ ); 43 | 44 | eval { 45 | validate( 46 | @p, { 47 | foo => { 48 | hype => SCALAR, 49 | callbacks => { 50 | 'one' => sub {1} 51 | }, 52 | }, 53 | bar => { type => SCALAR }, 54 | } 55 | ); 56 | }; 57 | 58 | like( $@, qr/is not an allowed validation spec key/ ); 59 | eval { 60 | validate( 61 | @p, { 62 | foo => { 63 | type => SCALAR, 64 | regexp => qr/^\d+$/, 65 | }, 66 | bar => { type => SCALAR }, 67 | } 68 | ); 69 | }; 70 | 71 | like( $@, qr/is not an allowed validation spec key/ ); 72 | } 73 | 74 | done_testing(); 75 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-32-regex-as-value.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use Params::Validate qw( validate SCALAR SCALARREF ); 17 | 18 | use Test::More; 19 | use Test::Fatal; 20 | 21 | is( 22 | exception { v( foo => qr/foo/ ) }, 23 | undef, 24 | 'no exception with regex object' 25 | ); 26 | 27 | is( 28 | exception { v( foo => 'foo' ) }, 29 | undef, 30 | 'no exception with plain scalar' 31 | ); 32 | 33 | my $foo = 'foo'; 34 | is( 35 | exception { v( foo => \$foo ) }, 36 | undef, 37 | 'no exception with scalar ref' 38 | ); 39 | 40 | done_testing(); 41 | 42 | sub v { 43 | validate( 44 | @_, { 45 | foo => { type => SCALAR | SCALARREF }, 46 | }, 47 | ); 48 | return; 49 | } 50 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-33-keep-errsv.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use Params::Validate qw( validate SCALAR ); 17 | 18 | use Test::More; 19 | 20 | { 21 | $@ = 'foo'; 22 | v( bar => 42 ); 23 | 24 | is( 25 | $@, 26 | 'foo', 27 | 'calling validate() does not clobber' 28 | ); 29 | } 30 | 31 | done_testing(); 32 | 33 | sub v { 34 | validate( @_, { bar => { type => SCALAR } } ); 35 | } 36 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-34-recursive-validation.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use Test::Fatal; 17 | use Test::More; 18 | 19 | { 20 | package Foo; 21 | 22 | use Params::Validate qw( validate SCALAR ); 23 | 24 | Params::Validate::validation_options( allow_extra => 1 ); 25 | 26 | sub test_foo { 27 | my %p = validate( @_, { arg1 => { type => SCALAR } } ); 28 | print "test foo\n"; 29 | } 30 | } 31 | 32 | { 33 | package Bar; 34 | 35 | use Params::Validate qw( validate SCALAR ); 36 | Params::Validate::validation_options( allow_extra => 0 ); 37 | 38 | sub test_bar { 39 | 40 | # catch die signal 41 | local $SIG{__DIE__} = sub { 42 | 43 | # we died from within Params::Validate (because of wrong_Arg) we 44 | # call Foo::test_foo with OK args, but it'll die, because 45 | # Params::Validate::PP::options is still set to the options of the 46 | # Bar package, and so it won't retreive the one from Foo. 47 | Foo::test_foo( arg1 => 1, extra_arg => 2 ); 48 | }; 49 | 50 | # this will die because the arg received is 'wrong_arg' 51 | my %p = validate( @_, { arg1 => { type => SCALAR } } ); 52 | } 53 | } 54 | 55 | { 56 | # This bug only manifests with the pure Perl code because of its use of local 57 | # to remember the per-package options. 58 | local $TODO = 'Not sure how to fix this one'; 59 | unlike( 60 | exception { Bar::test_bar( bad_arg => 2 ) }, 61 | qr/was passed in the call to Foo::test_foo/, 62 | 'no exception from Foo::test_foo when when calling validate() from within a __DIE__ handler' 63 | ); 64 | } 65 | 66 | done_testing(); 67 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-35-default-xs-bug.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use Test::More 0.88; 17 | 18 | use Params::Validate qw( :all ); 19 | 20 | default_test(); 21 | 22 | done_testing(); 23 | 24 | sub default_test { 25 | my ( $first, $second ) = validate_pos( 26 | @_, 27 | { type => SCALAR, optional => 1 }, 28 | { type => SCALAR, optional => 1, default => 'must be second one' }, 29 | ); 30 | 31 | is( $first, undef, 'no default for first parameter' ); 32 | is( $second, 'must be second one', 33 | 'default for second parameter is applied' ); 34 | } 35 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-36-large-arrays.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use Test::Fatal; 17 | use Test::More; 18 | 19 | { 20 | package Foo; 21 | 22 | use Params::Validate qw( validate ARRAYREF ); 23 | 24 | sub v1 { 25 | my %p = validate( 26 | @_, { 27 | array => { 28 | callbacks => { 29 | 'checking array contents' => sub { 30 | for my $x ( @{ $_[0] } ) { 31 | return 0 unless defined $x && !ref $x; 32 | } 33 | return 1; 34 | }, 35 | } 36 | } 37 | } 38 | ); 39 | return $p{array}; 40 | } 41 | } 42 | 43 | { 44 | for my $size ( 100, 1_000, 100_000 ) { 45 | my @array = ('x') x $size; 46 | is_deeply( 47 | Foo::v1( array => \@array ), 48 | \@array, 49 | "validate() handles $size element array correctly" 50 | ); 51 | } 52 | } 53 | 54 | done_testing(); 55 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-37-exports.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use Test::More; 17 | use Params::Validate (); 18 | 19 | my @types = qw( 20 | SCALAR 21 | ARRAYREF 22 | HASHREF 23 | CODEREF 24 | GLOB 25 | GLOBREF 26 | SCALARREF 27 | HANDLE 28 | BOOLEAN 29 | UNDEF 30 | OBJECT 31 | ); 32 | 33 | my @subs = qw( 34 | validate 35 | validate_pos 36 | validation_options 37 | validate_with 38 | ); 39 | 40 | is_deeply( 41 | [ sort @Params::Validate::EXPORT_OK ], 42 | [ sort @types, @subs, 'set_options' ], 43 | '@EXPORT_OK' 44 | ); 45 | 46 | is_deeply( 47 | [ sort keys %Params::Validate::EXPORT_TAGS ], 48 | [qw( all types )], 49 | 'keys %EXPORT_TAGS' 50 | ); 51 | 52 | is_deeply( 53 | [ sort @{ $Params::Validate::EXPORT_TAGS{all} } ], 54 | [ sort @types, @subs ], 55 | '$EXPORT_TAGS{all}', 56 | ); 57 | 58 | is_deeply( 59 | [ sort @{ $Params::Validate::EXPORT_TAGS{types} } ], 60 | [ sort @types ], 61 | '$EXPORT_TAGS{types}', 62 | ); 63 | 64 | done_testing(); 65 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-39-reentrant.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | BEGIN { 10 | $ENV{PV_TEST_PERL} = 1; 11 | } 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use Params::Validate qw( validate SCALAR ); 17 | use Test::More; 18 | 19 | for my $i ( 1 .. 1000 ) { 20 | ok( bar(), 'bar()' ); 21 | is( foo( foo => $i ), $i, "reentrant validation works ($i)" ); 22 | } 23 | 24 | done_testing(); 25 | 26 | sub foo { 27 | my %p = validate( 28 | @_, 29 | { 30 | foo => { 31 | callbacks => { 32 | 'call bar' => sub { bar() } 33 | }, 34 | }, 35 | }, 36 | ); 37 | 38 | return $p{foo}; 39 | } 40 | 41 | sub bar { 42 | my %p = baz( baz => 42 ); 43 | 44 | return $p{baz} == 42; 45 | } 46 | 47 | sub baz { 48 | my %p = validate( 49 | @_, 50 | { 51 | baz => { 52 | type => SCALAR, 53 | callbacks => { 54 | 'is num' => sub { $_[0] =~ /^\d+$/ }, 55 | }, 56 | }, 57 | }, 58 | ); 59 | 60 | return %p; 61 | } 62 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-pp-is-loaded.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | use strict; 10 | use warnings; 11 | 12 | use Test::More; 13 | 14 | BEGIN { 15 | $ENV{PV_TEST_PERL} = 1; 16 | $ENV{PV_WARN_FAILED_IMPLEMENTATION} = 1; 17 | } 18 | 19 | use Module::Implementation 0.04 (); 20 | use Params::Validate; 21 | 22 | is( 23 | Module::Implementation::implementation_for('Params::Validate'), 24 | 'PP', 25 | 'PP implementation is loaded when env var is set' 26 | ); 27 | 28 | done_testing(); 29 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-xs-is-loaded.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | use strict; 10 | use warnings; 11 | 12 | use Test::More; 13 | 14 | BEGIN { $ENV{PV_WARN_FAILED_IMPLEMENTATION} = 1 } 15 | 16 | use Module::Implementation 0.04 (); 17 | use Params::Validate; 18 | 19 | is( 20 | Module::Implementation::implementation_for('Params::Validate'), 21 | 'XS', 22 | 'XS implementation is loaded by default' 23 | ); 24 | 25 | done_testing(); 26 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-xs-segfault.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | use strict; 10 | use warnings; 11 | 12 | use Test::More; 13 | 14 | BEGIN { 15 | $ENV{PARAMS_VALIDATE_IMPLEMENTATION} = 'XS'; 16 | $ENV{PV_WARN_FAILED_IMPLEMENTATION} = 1; 17 | } 18 | 19 | use Params::Validate qw( validate SCALAR ); 20 | 21 | eval { foo( { a => 1 } ) }; 22 | 23 | ok(1, 'did not segfault'); 24 | 25 | done_testing(); 26 | 27 | sub foo { 28 | validate( 29 | @_, 30 | { 31 | a => { type => SCALAR, depends => ['%s%s%s'] }, 32 | } 33 | ); 34 | } 35 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/author-xs-stack-realloc.t: -------------------------------------------------------------------------------- 1 | 2 | BEGIN { 3 | unless ($ENV{AUTHOR_TESTING}) { 4 | require Test::More; 5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); 6 | } 7 | } 8 | 9 | use strict; 10 | use warnings; 11 | 12 | use Test::More; 13 | 14 | BEGIN { 15 | $ENV{PARAMS_VALIDATE_IMPLEMENTATION} = 'XS'; 16 | $ENV{PV_WARN_FAILED_IMPLEMENTATION} = 1; 17 | } 18 | 19 | use Params::Validate qw( validate_with ); 20 | 21 | my $alloc_size; 22 | for my $i ( 0 .. 15 ) { 23 | $alloc_size = 2**$i; 24 | test_array_spec(undef); 25 | } 26 | 27 | ok( 1, 'array validation succeeded with stack realloc' ); 28 | 29 | for my $i ( 0 .. 15 ) { 30 | $alloc_size = 2**$i; 31 | test_hash_spec( a => undef ); 32 | } 33 | 34 | ok( 1, 'hash validation succeeded with stack realloc' ); 35 | 36 | done_testing(); 37 | 38 | sub grow_stack { 39 | my @stuff = (1) x $alloc_size; 40 | 41 | # "validation" always succeeds - we just need the stack to grow inside a 42 | # callback to trigger the bug. 43 | return 1; 44 | } 45 | 46 | sub test_array_spec { 47 | my @args = validate_with( 48 | params => \@_, 49 | spec => [ { callbacks => { grow_stack => \&grow_stack } } ], 50 | ); 51 | } 52 | 53 | sub test_hash_spec { 54 | my %args = validate_with( 55 | params => \@_, 56 | spec => { 57 | a => { callbacks => { grow_stack => \&grow_stack } }, 58 | }, 59 | ); 60 | } 61 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/lib/PVTests.pm: -------------------------------------------------------------------------------- 1 | package PVTests; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Test::More; 7 | 8 | 1; 9 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/lib/PVTests/Callbacks.pm: -------------------------------------------------------------------------------- 1 | package PVTests::Callbacks; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Params::Validate qw(:all); 7 | 8 | use PVTests; 9 | use Test::More; 10 | 11 | sub run_tests { 12 | my %allowed = ( foo => 1, baz => 1 ); 13 | eval { 14 | my @a = ( foo => 'foo' ); 15 | validate( 16 | @a, { 17 | foo => { 18 | callbacks => { 19 | is_allowed => sub { $allowed{ lc $_[0] } } 20 | }, 21 | } 22 | } 23 | ); 24 | }; 25 | is( $@, q{} ); 26 | 27 | eval { 28 | my @a = ( foo => 'aksjgakl' ); 29 | 30 | validate( 31 | @a, { 32 | foo => { 33 | callbacks => { 34 | is_allowed => sub { $allowed{ lc $_[0] } } 35 | }, 36 | } 37 | } 38 | ); 39 | }; 40 | 41 | if ( $ENV{PERL_NO_VALIDATION} ) { 42 | is( $@, q{} ); 43 | } 44 | else { 45 | like( $@, qr/is_allowed/ ); 46 | } 47 | 48 | # duplicates code from Lingua::ZH::CCDICT that revealad bug fixed in 49 | # 0.56. 50 | eval { Foo->new( storage => 'InMemory', file => 'something' ); }; 51 | is( $@, q{} ); 52 | 53 | done_testing(); 54 | } 55 | 56 | package Foo; 57 | 58 | use Params::Validate qw(:all); 59 | 60 | my %storage = map { lc $_ => $_ } (qw( InMemory XML BerkeleyDB )); 61 | 62 | sub new { 63 | my $class = shift; 64 | 65 | local $^W = 1; 66 | 67 | my %p = validate_with( 68 | params => \@_, 69 | spec => { 70 | storage => { 71 | callbacks => { 72 | 'is a valid storage type' => sub { $storage{ lc $_[0] } } 73 | }, 74 | }, 75 | }, 76 | allow_extra => 1, 77 | ); 78 | 79 | return 1; 80 | } 81 | 82 | 1; 83 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/release-cpan-changes.t: -------------------------------------------------------------------------------- 1 | #!perl 2 | 3 | BEGIN { 4 | unless ($ENV{RELEASE_TESTING}) { 5 | require Test::More; 6 | Test::More::plan(skip_all => 'these tests are for release candidate testing'); 7 | } 8 | } 9 | 10 | 11 | use strict; 12 | use warnings; 13 | 14 | use Test::More 0.96 tests => 2; 15 | use_ok('Test::CPAN::Changes'); 16 | subtest 'changes_ok' => sub { 17 | changes_file_ok('Changes'); 18 | }; 19 | done_testing(); 20 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/release-meta-json.t: -------------------------------------------------------------------------------- 1 | #!perl 2 | 3 | BEGIN { 4 | unless ($ENV{RELEASE_TESTING}) { 5 | require Test::More; 6 | Test::More::plan(skip_all => 'these tests are for release candidate testing'); 7 | } 8 | } 9 | 10 | 11 | use Test::CPAN::Meta::JSON; 12 | meta_json_ok(); 13 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/release-pod-coverage.t: -------------------------------------------------------------------------------- 1 | #!perl 2 | 3 | BEGIN { 4 | unless ($ENV{RELEASE_TESTING}) { 5 | require Test::More; 6 | Test::More::plan(skip_all => 'these tests are for release candidate testing'); 7 | } 8 | } 9 | 10 | # This file was automatically generated by Dist::Zilla::Plugin::Test::Pod::Coverage::Configurable. 11 | 12 | use Test::Pod::Coverage 1.08; 13 | use Test::More 0.88; 14 | 15 | BEGIN { 16 | if ( $] <= 5.008008 ) { 17 | plan skip_all => 'These tests require Pod::Coverage::TrustPod, which only works with Perl 5.8.9+'; 18 | } 19 | } 20 | use Pod::Coverage::TrustPod; 21 | 22 | my %skip = map { $_ => 1 } qw( Params::Validate::Constants Params::Validate::PP Params::Validate::XS Params::ValidatePP Params::ValidateXS ); 23 | 24 | my @modules; 25 | for my $module ( all_modules() ) { 26 | next if $skip{$module}; 27 | 28 | push @modules, $module; 29 | } 30 | 31 | plan skip_all => 'All the modules we found were excluded from POD coverage test.' 32 | unless @modules; 33 | 34 | plan tests => scalar @modules; 35 | 36 | my %trustme = ( 37 | 'Params::Validate' => [ 38 | qr/^(?:UNKNOWN|set_options|validate(?:_pos|_with)?|validation_options)$/ 39 | ] 40 | ); 41 | 42 | my @also_private; 43 | 44 | for my $module ( sort @modules ) { 45 | pod_coverage_ok( 46 | $module, 47 | { 48 | coverage_class => 'Pod::Coverage::TrustPod', 49 | also_private => \@also_private, 50 | trustme => $trustme{$module} || [], 51 | }, 52 | "pod coverage for $module" 53 | ); 54 | } 55 | 56 | done_testing(); 57 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/release-pod-linkcheck.t: -------------------------------------------------------------------------------- 1 | #!perl 2 | 3 | BEGIN { 4 | unless ($ENV{RELEASE_TESTING}) { 5 | require Test::More; 6 | Test::More::plan(skip_all => 'these tests are for release candidate testing'); 7 | } 8 | } 9 | 10 | 11 | use strict; 12 | use warnings; 13 | use Test::More; 14 | 15 | foreach my $env_skip ( qw( 16 | SKIP_POD_LINKCHECK 17 | ) ){ 18 | plan skip_all => "\$ENV{$env_skip} is set, skipping" 19 | if $ENV{$env_skip}; 20 | } 21 | 22 | eval "use Test::Pod::LinkCheck"; 23 | if ( $@ ) { 24 | plan skip_all => 'Test::Pod::LinkCheck required for testing POD'; 25 | } 26 | else { 27 | Test::Pod::LinkCheck->new->all_pod_ok; 28 | } 29 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/release-pod-no404s.t: -------------------------------------------------------------------------------- 1 | #!perl 2 | 3 | BEGIN { 4 | unless ($ENV{RELEASE_TESTING}) { 5 | require Test::More; 6 | Test::More::plan(skip_all => 'these tests are for release candidate testing'); 7 | } 8 | } 9 | 10 | 11 | use strict; 12 | use warnings; 13 | use Test::More; 14 | 15 | foreach my $env_skip ( qw( 16 | SKIP_POD_NO404S 17 | AUTOMATED_TESTING 18 | ) ){ 19 | plan skip_all => "\$ENV{$env_skip} is set, skipping" 20 | if $ENV{$env_skip}; 21 | } 22 | 23 | eval "use Test::Pod::No404s"; 24 | if ( $@ ) { 25 | plan skip_all => 'Test::Pod::No404s required for testing POD'; 26 | } 27 | else { 28 | all_pod_files_ok(); 29 | } 30 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/release-portability.t: -------------------------------------------------------------------------------- 1 | #!perl 2 | 3 | BEGIN { 4 | unless ($ENV{RELEASE_TESTING}) { 5 | require Test::More; 6 | Test::More::plan(skip_all => 'these tests are for release candidate testing'); 7 | } 8 | } 9 | 10 | 11 | use strict; 12 | use warnings; 13 | 14 | use Test::More; 15 | 16 | eval 'use Test::Portability::Files'; 17 | plan skip_all => 'Test::Portability::Files required for testing portability' 18 | if $@; 19 | 20 | run_tests(); 21 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/t/release-synopsis.t: -------------------------------------------------------------------------------- 1 | #!perl 2 | 3 | BEGIN { 4 | unless ($ENV{RELEASE_TESTING}) { 5 | require Test::More; 6 | Test::More::plan(skip_all => 'these tests are for release candidate testing'); 7 | } 8 | } 9 | 10 | 11 | use Test::Synopsis; 12 | 13 | all_synopsis_ok(); 14 | -------------------------------------------------------------------------------- /modules/Params-Validate-1.23/xs/Makefile.PL: -------------------------------------------------------------------------------- 1 | use ExtUtils::MakeMaker; 2 | 3 | WriteMakefile( 4 | NAME => 'Params::Validate::XS', 5 | VERSION_FROM => '../lib/Params/Validate.pm', 6 | OBJECT => '$(O_FILES)', 7 | NO_MYMETA => 1, 8 | ); 9 | -------------------------------------------------------------------------------- /modules/RRD-Tweak-1.00/Changes: -------------------------------------------------------------------------------- 1 | Revision history for RRD-Tweak 2 | 3 | 1.00 2012-08-06 4 | First production release 5 | 6 | 0.11 2012-07-23 7 | 27b27b3 added sponsors in Acknowledgements 8 | 88a10ac _populate_rra(): do not populate Holt-Winters arrays 9 | 10 | 0.10 2012-07-22 11 | b11aebc _populate_rra(): populate only NaN rows 12 | fa4e30e when an RRA grows, try to derive the data from other RRAs 13 | 14 | 0.09 2012-07-19 15 | 76a0045 New method: has_hwpredict() 16 | 8c2375c strict and warnings in test files 17 | 682438e del_rra() now handles Holt-Winters arrays 18 | a36d932 deleted t/05-boilerplate.t 19 | 20 | 0.08 2012-07-10 21 | 5b2cc36 added debugging information 22 | 6030cd4 Replaced random() with rand() because of issues in RHEL4 23 | 24 | 0.07 2012-07-09 25 | 2a3907d Build.PL: create_makefile_pl => small 26 | 263b4a7 README updated 27 | 28 | 0.05 2012-07-02 29 | afa5bc0 added rra_descr(), ds_descr(); prohibited del_rra() for HW files 30 | 31 | 0.04 2012-06-27 32 | f6c47d6 Bugfix: modify_rra incorrectly reduced RRA size 33 | 34 | 0.03 2012-06-26 35 | Documentation update 36 | Build.PL uses pkg-config 37 | 38 | 0.01 2012-06-22 39 | First release 40 | -------------------------------------------------------------------------------- /modules/RRD-Tweak-1.00/DEBUGGING: -------------------------------------------------------------------------------- 1 | perl Build.PL --config optimize='-g -O0' 2 | ./Build 3 | gdb -x cmds.gdb /usr/bin/perl 4 | 5 | -------------------------------------------------------------------------------- /modules/RRD-Tweak-1.00/MANIFEST: -------------------------------------------------------------------------------- 1 | Changes 2 | cmds.gdb 3 | DEBUGGING 4 | lib/RRD/Tweak.pm 5 | Tweak.xs 6 | Makefile.PL 7 | MANIFEST This list of files 8 | META.yml 9 | README 10 | t/00-load.t 11 | t/05-manifest.t 12 | t/05-pod-coverage.t 13 | t/05-pod.t 14 | t/10-create_rrd.t 15 | t/20-leaktrace.skip 16 | t/20-load_save_rrd.t 17 | t/30-add_del_ds_rra.t 18 | t/30-add_rra.t 19 | t/30-del_rra_holtwinters.t 20 | t/30-modify_ds.t 21 | t/30-modify_rra.t 22 | -------------------------------------------------------------------------------- /modules/RRD-Tweak-1.00/META.yml: -------------------------------------------------------------------------------- 1 | --- 2 | abstract: 'RRD file manipulation' 3 | author: 4 | - 'Stanislav Sinyagin ' 5 | build_requires: 6 | Data::Compare: 0 7 | Data::Dumper: 0 8 | ExtUtils::CBuilder: 0 9 | RRDs: 0 10 | Test::More: 0 11 | configure_requires: 12 | Module::Build: 0.36 13 | generated_by: 'Module::Build version 0.3603' 14 | license: gpl 15 | meta-spec: 16 | url: http://module-build.sourceforge.net/META-spec-v1.4.html 17 | version: 1.4 18 | name: RRD-Tweak 19 | provides: 20 | RRD::Tweak: 21 | file: lib/RRD/Tweak.pm 22 | version: 1.00 23 | requires: 24 | perl: v5.8.8 25 | resources: 26 | license: http://opensource.org/licenses/gpl-license.php 27 | version: 1.00 28 | -------------------------------------------------------------------------------- /modules/RRD-Tweak-1.00/Makefile.PL: -------------------------------------------------------------------------------- 1 | use strict; 2 | use ExtUtils::MakeMaker; 3 | use Config; 4 | 5 | my $compiler_flags; 6 | if(defined($ENV{RRDTWEAK_CFLAGS}) ) { 7 | $compiler_flags = ' ' . $ENV{RRDTWEAK_CFLAGS}; 8 | } else { 9 | $compiler_flags = `pkg-config librrd --cflags`; 10 | $compiler_flags =~ s/\s+$//m; 11 | } 12 | 13 | my $linker_flags; 14 | if(defined($ENV{RRDTWEAK_LDFLAGS}) ) { 15 | $linker_flags = ' ' . $ENV{RRDTWEAK_LDFLAGS}; 16 | } else { 17 | $linker_flags = `pkg-config librrd --libs`; 18 | $linker_flags =~ s/\s+$//m; 19 | } 20 | $linker_flags = length($linker_flags) ? 21 | [split(/\s+/,$linker_flags)]:undef; 22 | 23 | #my $compiler_flags = `pkg-config librrd --cflags`; 24 | #$compiler_flags =~ s/\s+$//m; 25 | #if( defined($ENV{RRDTWEAK_CFLAGS}) ) { 26 | # $compiler_flags .= ' ' . $ENV{RRDTWEAK_CFLAGS}; 27 | #} 28 | #$compiler_flags = length($compiler_flags) ? 29 | # [split(/\s+/,$compiler_flags)]:undef; 30 | # 31 | #my $linker_flags = `pkg-config librrd --libs`; 32 | #$linker_flags =~ s/\s+$//m; 33 | #if( defined($ENV{RRDTWEAK_LDFLAGS}) ) { 34 | # $linker_flags .= ' ' . $ENV{RRDTWEAK_LDFLAGS}; 35 | #} 36 | #$linker_flags = length($linker_flags) ? 37 | # [split(/\s+/,$linker_flags)]:undef; 38 | 39 | WriteMakefile( 40 | dist => { 41 | PREOP => 'pod2text lib/RRD/Tweak.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', 42 | COMPRESS => 'gzip -9v', 43 | SUFFIX => '.gz', 44 | }, 45 | NAME => 'RRD::Tweak', 46 | VERSION_FROM => 'lib/RRD/Tweak.pm', 47 | ABSTRACT => 'RRD file manipulation', 48 | AUTHOR => 'Stanislav Sinyagin ', 49 | LICENSE => 'gpl', 50 | BUILD_REQUIRES => { 51 | 'Test::More' => 0, 52 | 'Data::Compare' => 0, 53 | 'Data::Dumper' => 0, 54 | 'ExtUtils::CBuilder' => 0, 55 | 'RRDs' => 0, 56 | }, 57 | PREREQ_PM => { 58 | 'RRDs' => 0, 59 | }, 60 | CCFLAGS => $compiler_flags, 61 | LIBS => $linker_flags, 62 | ); 63 | -------------------------------------------------------------------------------- /modules/RRD-Tweak-1.00/cmds.gdb: -------------------------------------------------------------------------------- 1 | set breakpoint pending on 2 | set args -t -Mblib t/10-create_rrd.t 3 | b XS___save_file 4 | r 5 | -------------------------------------------------------------------------------- /modules/RRD-Tweak-1.00/t/00-load.t: -------------------------------------------------------------------------------- 1 | #!perl -T 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use Test::More tests => 1; 7 | 8 | BEGIN { 9 | use_ok( 'RRD::Tweak' ) || print "Bail out! 10 | "; 11 | } 12 | 13 | diag( "Testing RRD::Tweak $RRD::Tweak::VERSION, Perl $], $^X" ); 14 | -------------------------------------------------------------------------------- /modules/RRD-Tweak-1.00/t/05-manifest.t: -------------------------------------------------------------------------------- 1 | #!perl -T 2 | 3 | use strict; 4 | use warnings; 5 | use Test::More; 6 | 7 | unless ( $ENV{RELEASE_TESTING} ) { 8 | plan( skip_all => "Author tests not required for installation" ); 9 | } 10 | 11 | eval "use Test::CheckManifest 0.9"; 12 | plan skip_all => "Test::CheckManifest 0.9 required" if $@; 13 | ok_manifest(); 14 | -------------------------------------------------------------------------------- /modules/RRD-Tweak-1.00/t/05-pod-coverage.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | use Test::More; 4 | 5 | # Ensure a recent version of Test::Pod::Coverage 6 | my $min_tpc = 1.08; 7 | eval "use Test::Pod::Coverage $min_tpc"; 8 | plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage" 9 | if $@; 10 | 11 | # Test::Pod::Coverage doesn't require a minimum Pod::Coverage version, 12 | # but older versions don't recognize some common documentation styles 13 | my $min_pc = 0.18; 14 | eval "use Pod::Coverage $min_pc"; 15 | plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage" 16 | if $@; 17 | 18 | all_pod_coverage_ok(); 19 | -------------------------------------------------------------------------------- /modules/RRD-Tweak-1.00/t/05-pod.t: -------------------------------------------------------------------------------- 1 | #!perl -T 2 | 3 | use strict; 4 | use warnings; 5 | use Test::More; 6 | 7 | # Ensure a recent version of Test::Pod 8 | my $min_tp = 1.22; 9 | eval "use Test::Pod $min_tp"; 10 | plan skip_all => "Test::Pod $min_tp required for testing POD" if $@; 11 | 12 | all_pod_files_ok(); 13 | -------------------------------------------------------------------------------- /modules/RRD-Tweak-1.00/t/20-leaktrace.skip: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | 4 | use Test::More tests => 3; 5 | use Test::LeakTrace; 6 | 7 | 8 | use File::Temp qw/tmpnam/; 9 | use RRDs; 10 | use Data::Dumper; 11 | 12 | BEGIN { 13 | use_ok('RRD::Tweak', "use RRD::Tweak") or 14 | BAIL_OUT("cannot load the module"); 15 | } 16 | 17 | diag("Testing RRD::Tweak $RRD::Tweak::VERSION, Perl $], $^X"); 18 | 19 | my $filename1 = tmpnam(); 20 | 21 | # 1326585600 = Sun Jan 15 01:00:00 2012 22 | RRDs::create($filename1, '--step', '300', 23 | '--start', '1326585600', 24 | 'DS:x1:GAUGE:600:-1e10:1e15', 25 | 'DS:x2:GAUGE:600:0.0001:U', 26 | 'DS:x3:GAUGE:600:0.0001:U', 27 | 'RRA:AVERAGE:0:1:20', 28 | 'RRA:AVERAGE:0.17:6:20'); 29 | 30 | 31 | my $err = RRDs::error(); 32 | ok((not $err), "creating RRD file: $filename1") or 33 | BAIL_OUT("Cannot create RRD file: " . $err); 34 | 35 | leaks_cmp_ok{ 36 | for my $x (0..3) { 37 | my $rrd = RRD::Tweak->new(); 38 | $rrd->load_file($filename1); 39 | } 40 | } '<', 1; 41 | 42 | 43 | unlink $filename1; 44 | 45 | 46 | 47 | # Local Variables: 48 | # mode: cperl 49 | # indent-tabs-mode: nil 50 | # cperl-indent-level: 4 51 | # cperl-continued-statement-offset: 4 52 | # cperl-continued-brace-offset: -4 53 | # cperl-brace-offset: 0 54 | # cperl-label-offset: -2 55 | # End: 56 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/Changes: -------------------------------------------------------------------------------- 1 | Revision history for Perl extension Text-Markdown-Hoedown 2 | 3 | 1.01 2013-11-24T10:17:40Z 4 | 5 | - Fixed memory allocation related bug. 6 | (It affects under the -Dusemymalloc=y environments) 7 | (supported by bingos++) 8 | 9 | 1.00 2013-11-20T11:38:19Z 10 | 11 | [INCOMPATIBLE CHANGES] 12 | - Switch to hoedown 2.0.0. 13 | Modified low level APIs. If you are using undocumented low level APIs, 14 | your application may not work correctly! 15 | (tokuhirom) 16 | 17 | 0.07 2013-10-02T00:38:28Z 18 | 19 | - Documented low level API. 20 | (tokuhirom) 21 | 22 | 0.06 2013-10-01T13:11:59Z 23 | 24 | - set __USE_MINGW_ANSI_STDIO=1 to let vsnprintf in mingw 25 | (charsbar) 26 | - specify the correct ret value. 27 | 28 | 0.05 2013-10-01T02:15:31Z 29 | 30 | - MSVC fix comes from hoedown upstream. 31 | (Reported by charsbar++) 32 | 33 | 0.04 2013-09-30T11:03:15Z 34 | 35 | - CONST() macro conflict with MinGW. 36 | (reported by mattn++) 37 | 38 | 0.03 2013-09-30T09:19:31Z 39 | 40 | - Custom handler support(Not documented yet). 41 | (tokuhirom) 42 | 43 | 0.02 2013-09-28T09:53:42Z 44 | 45 | [Incompatible Changes] 46 | - All APIs are modified! 47 | - Constants are exported. 48 | - Supported TOC! 49 | 50 | 0.01 2013-09-28T02:45:39Z 51 | 52 | - original version 53 | 54 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/META.json: -------------------------------------------------------------------------------- 1 | { 2 | "abstract" : "Text::Markdown::Hoedown is binding library for hoedown.", 3 | "author" : [ 4 | "tokuhirom " 5 | ], 6 | "dynamic_config" : 1, 7 | "generated_by" : "ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter version 2.150001", 8 | "license" : [ 9 | "perl_5" 10 | ], 11 | "meta-spec" : { 12 | "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", 13 | "version" : "2" 14 | }, 15 | "name" : "Text-Markdown-Hoedown", 16 | "no_index" : { 17 | "directory" : [ 18 | "t", 19 | "inc" 20 | ] 21 | }, 22 | "prereqs" : { 23 | "build" : { 24 | "requires" : { 25 | "Test::More" : "0", 26 | "perl" : "5.008001" 27 | } 28 | }, 29 | "configure" : { 30 | "requires" : { 31 | "ExtUtils::MakeMaker" : "0" 32 | } 33 | }, 34 | "runtime" : { 35 | "requires" : { 36 | "ExtUtils::ParseXS" : "3.22", 37 | "parent" : "0" 38 | } 39 | } 40 | }, 41 | "release_status" : "stable", 42 | "version" : "1.01" 43 | } 44 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/META.yml: -------------------------------------------------------------------------------- 1 | --- 2 | abstract: 'Text::Markdown::Hoedown is binding library for hoedown.' 3 | author: 4 | - 'tokuhirom ' 5 | build_requires: 6 | Test::More: '0' 7 | perl: '5.008001' 8 | configure_requires: 9 | ExtUtils::MakeMaker: '0' 10 | dynamic_config: 1 11 | generated_by: 'ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter version 2.150001' 12 | license: perl 13 | meta-spec: 14 | url: http://module-build.sourceforge.net/META-spec-v1.4.html 15 | version: '1.4' 16 | name: Text-Markdown-Hoedown 17 | no_index: 18 | directory: 19 | - t 20 | - inc 21 | requires: 22 | ExtUtils::ParseXS: '3.22' 23 | parent: '0' 24 | version: '1.01' 25 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/Makefile.PL: -------------------------------------------------------------------------------- 1 | use strict; 2 | use ExtUtils::MakeMaker 6.64; 3 | use Config; 4 | 5 | my $myextlib = 'hoedown/libhoedown$(LIB_EXT)'; 6 | 7 | WriteMakefile( 8 | dist => { 9 | PREOP => 'pod2text lib/Text/Markdown/Hoedown.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', 10 | COMPRESS => 'gzip -9v', 11 | SUFFIX => '.gz', 12 | }, 13 | NAME => 'Text::Markdown::Hoedown', 14 | VERSION_FROM => 'lib/Text/Markdown/Hoedown.pm', 15 | ABSTRACT => 'Text::Markdown::Hoedown is binding library for hoedown.', 16 | AUTHOR => 'tokuhirom ', 17 | LICENSE => 'perl', 18 | BUILD_REQUIRES => { 19 | perl => "5.008001", 20 | }, 21 | TEST_REQUIRES => { 22 | 'Test::More' => 0, 23 | }, 24 | PREREQ_PM => { 25 | 'ExtUtils::ParseXS' => '3.22', 26 | 'parent' => 0, 27 | }, 28 | INC => '-Ihoedown', 29 | MYEXTLIB => $myextlib, 30 | ); 31 | 32 | # We don't want the default subdir rule, as it creates a race condition with the 33 | # rule we add below. 34 | sub MY::subdir_x { return '' } 35 | 36 | sub MY::postamble { 37 | return <<'EOT'; 38 | $(MYEXTLIB) : hoedown/Makefile 39 | cd hoedown && $(MAKE) 40 | EOT 41 | } 42 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/author/benchmark.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | use strict; 3 | use warnings; 4 | 5 | use Text::Markdown; 6 | use Text::Markdown::Discount; 7 | use Text::Markdown::Hoedown; 8 | 9 | use Benchmark qw(cmpthese); 10 | 11 | my $markdown_text = <<'...'; 12 | [test]: http://google.com/ "Google" 13 | 14 | # A heading 15 | 16 | Just a note, I've found that I can't test my markdown parser vs others. 17 | For example, both markdown.js and showdown code blocks in lists wrong. They're 18 | also completely [inconsistent][test] with regards to paragraphs in list items. 19 | 20 | A link. Not anymore. 21 | 22 | 24 | 25 | * List Item 1 26 | 27 | * List Item 2 28 | * New List Item 1 29 | Hi, this is a list item. 30 | * New List Item 2 31 | Another item 32 | Code goes here. 33 | Lots of it... 34 | * New List Item 3 35 | The last item 36 | 37 | * List Item 3 38 | The final item. 39 | 40 | * List Item 4 41 | The real final item. 42 | 43 | Paragraph. 44 | ... 45 | 46 | cmpthese(-5, { 47 | markdown => sub { Text::Markdown::markdown($markdown_text); }, 48 | discount => sub { Text::Markdown::Discount::markdown($markdown_text); }, 49 | hoedown => sub { Text::Markdown::Hoedown::markdown($markdown_text); }, 50 | }); 51 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/author/tmpl/Callbacks.pod: -------------------------------------------------------------------------------- 1 | ? my @callbacks = @_; 2 | 3 | =head1 NAME 4 | 5 | Text::Markdown::Hoedown::Callbacks - Callbacks 6 | 7 | =head1 DESCRIPTION 8 | 9 | Note. Any API will change without notice. 10 | 11 | =head1 PRESETS 12 | 13 | There is 2 presets. 14 | 15 | =over 4 16 | 17 | =item C<< my $cb = Text::Markdown::Hoedown::Callbacks->html_renderer($render_flags:UV, $toc_nesting_lvl:IV); >> 18 | 19 | Create a callback object from HTML presets. Arguments are documented on L. 20 | 21 | =item C<< my $cb = Text::Markdown::Hoedown::Callbacks->html_toc_renderer($nesting_level); >> 22 | 23 | Create a callback object from HTML TOC presets. Arguments are documented on L. 24 | 25 | =back 26 | 27 | =head1 CUSTOM CALLBACKS 28 | 29 | =over 4 30 | 31 | =item C<< my $cb = Text::Markdown::Hoedown::Callbacks->new(); >> 32 | 33 | Create new instance. 34 | 35 | ? for my $cb (@callbacks) { 36 | 37 | =item C<< $cb->{name} ?>($code: CodeRef) >> 38 | 39 | Added handler for C< {name} ?> >. 40 | 41 | Callback function's signature is following: 42 | 43 | $code->({pp_args}}) ?>) 44 | 45 | ? } 46 | 47 | =back 48 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008, Natacha Porté 2 | Copyright (c) 2011, Vicent Martí 3 | Copyright (c) 2013, Devin Torres and the Hoedown authors 4 | 5 | Permission to use, copy, modify, and distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/autolink.h: -------------------------------------------------------------------------------- 1 | /* autolink.h - versatile autolinker */ 2 | 3 | #ifndef HOEDOWN_AUTOLINK_H 4 | #define HOEDOWN_AUTOLINK_H 5 | 6 | #include "buffer.h" 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | enum { 13 | HOEDOWN_AUTOLINK_SHORT_DOMAINS = (1 << 0) 14 | }; 15 | 16 | int 17 | hoedown_autolink_is_safe(const uint8_t *link, size_t link_len); 18 | 19 | size_t 20 | hoedown_autolink__www(size_t *rewind_p, hoedown_buffer *link, 21 | uint8_t *data, size_t offset, size_t size, unsigned int flags); 22 | 23 | size_t 24 | hoedown_autolink__email(size_t *rewind_p, hoedown_buffer *link, 25 | uint8_t *data, size_t offset, size_t size, unsigned int flags); 26 | 27 | size_t 28 | hoedown_autolink__url(size_t *rewind_p, hoedown_buffer *link, 29 | uint8_t *data, size_t offset, size_t size, unsigned int flags); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif /** HOEDOWN_AUTOLINK_H **/ 36 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/escape.h: -------------------------------------------------------------------------------- 1 | /* escape.h - escape utilities */ 2 | 3 | #ifndef HOEDOWN_ESCAPE_H 4 | #define HOEDOWN_ESCAPE_H 5 | 6 | #include "buffer.h" 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | extern void hoedown_escape_html(hoedown_buffer *ob, const uint8_t *src, size_t size, int secure); 13 | extern void hoedown_escape_href(hoedown_buffer *ob, const uint8_t *src, size_t size); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif /** HOEDOWN_ESCAPE_H **/ 20 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/hoedown.c: -------------------------------------------------------------------------------- 1 | #include "markdown.h" 2 | #include "html.h" 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define READ_UNIT 1024 10 | #define OUTPUT_UNIT 64 11 | 12 | int 13 | main(int argc, char **argv) 14 | { 15 | hoedown_buffer *ib, *ob; 16 | FILE *in = stdin; 17 | 18 | hoedown_renderer *renderer; 19 | hoedown_markdown *markdown; 20 | 21 | /* opening the file if given from the command line */ 22 | if (argc > 1) { 23 | in = fopen(argv[1], "r"); 24 | if (!in) { 25 | fprintf(stderr, "Unable to open input file \"%s\": %s\n", argv[1], strerror(errno)); 26 | return 1; 27 | } 28 | } 29 | 30 | /* reading everything */ 31 | ib = hoedown_buffer_new(READ_UNIT); 32 | while (!feof(in) && !ferror(in)) { 33 | hoedown_buffer_grow(ib, ib->size + READ_UNIT); 34 | ib->size += fread(ib->data + ib->size, 1, READ_UNIT, in); 35 | } 36 | 37 | if (in != stdin) 38 | fclose(in); 39 | 40 | /* performing markdown parsing */ 41 | ob = hoedown_buffer_new(OUTPUT_UNIT); 42 | 43 | renderer = hoedown_html_renderer_new(0, 0); 44 | markdown = hoedown_markdown_new(0, 16, renderer); 45 | 46 | hoedown_markdown_render(ob, ib->data, ib->size, markdown); 47 | 48 | hoedown_markdown_free(markdown); 49 | hoedown_html_renderer_free(renderer); 50 | 51 | /* writing the result to stdout */ 52 | (void)fwrite(ob->data, 1, ob->size, stdout); 53 | 54 | /* cleanup */ 55 | hoedown_buffer_free(ib); 56 | hoedown_buffer_free(ob); 57 | 58 | return ferror(stdout); 59 | } 60 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/html.h: -------------------------------------------------------------------------------- 1 | /* html.h - HTML renderer */ 2 | 3 | #ifndef HOEDOWN_HTML_H 4 | #define HOEDOWN_HTML_H 5 | 6 | #include "markdown.h" 7 | #include "buffer.h" 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef enum { 15 | HOEDOWN_HTML_SKIP_HTML = (1 << 0), 16 | HOEDOWN_HTML_SKIP_STYLE = (1 << 1), 17 | HOEDOWN_HTML_SKIP_IMAGES = (1 << 2), 18 | HOEDOWN_HTML_SKIP_LINKS = (1 << 3), 19 | HOEDOWN_HTML_EXPAND_TABS = (1 << 4), 20 | HOEDOWN_HTML_SAFELINK = (1 << 5), 21 | HOEDOWN_HTML_TOC = (1 << 6), 22 | HOEDOWN_HTML_HARD_WRAP = (1 << 7), 23 | HOEDOWN_HTML_USE_XHTML = (1 << 8), 24 | HOEDOWN_HTML_ESCAPE = (1 << 9), 25 | HOEDOWN_HTML_PRETTIFY = (1 << 10) 26 | } hoedown_html_render_mode; 27 | 28 | typedef enum { 29 | HOEDOWN_HTML_TAG_NONE = 0, 30 | HOEDOWN_HTML_TAG_OPEN, 31 | HOEDOWN_HTML_TAG_CLOSE 32 | } hoedown_html_tag; 33 | 34 | int 35 | hoedown_html_is_tag(const uint8_t *tag_data, size_t tag_size, const char *tagname); 36 | 37 | extern hoedown_renderer * 38 | hoedown_html_renderer_new(unsigned int render_flags, int nesting_level); 39 | 40 | extern hoedown_renderer * 41 | hoedown_html_toc_renderer_new(int nesting_level); 42 | 43 | extern void 44 | hoedown_html_renderer_free(hoedown_renderer *renderer); 45 | 46 | extern void 47 | hoedown_html_smartypants(hoedown_buffer *ob, const uint8_t *text, size_t size); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif /** HOEDOWN_HTML_H **/ 54 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/html_block_names.gperf: -------------------------------------------------------------------------------- 1 | p 2 | dl 3 | h1 4 | h2 5 | h3 6 | h4 7 | h5 8 | h6 9 | ol 10 | ul 11 | del 12 | div 13 | ins 14 | pre 15 | form 16 | math 17 | style 18 | table 19 | figure 20 | iframe 21 | script 22 | fieldset 23 | noscript 24 | blockquote 25 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/smartypants.c: -------------------------------------------------------------------------------- 1 | #include "html.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #define READ_UNIT 1024 9 | #define OUTPUT_UNIT 64 10 | 11 | int 12 | main(int argc, char **argv) 13 | { 14 | hoedown_buffer *ib, *ob; 15 | FILE *in = stdin; 16 | 17 | /* opening the file if given from the command line */ 18 | if (argc > 1) { 19 | in = fopen(argv[1], "r"); 20 | if (!in) { 21 | fprintf(stderr, "Unable to open input file \"%s\": %s\n", argv[1], strerror(errno)); 22 | return 1; 23 | } 24 | } 25 | 26 | /* reading everything */ 27 | ib = hoedown_buffer_new(READ_UNIT); 28 | while (!feof(in) && !ferror(in)) { 29 | hoedown_buffer_grow(ib, ib->size + READ_UNIT); 30 | ib->size += fread(ib->data + ib->size, 1, READ_UNIT, in); 31 | } 32 | 33 | if (in != stdin) 34 | fclose(in); 35 | 36 | /* performing SmartyPants parsing */ 37 | ob = hoedown_buffer_new(OUTPUT_UNIT); 38 | 39 | hoedown_html_smartypants(ob, ib->data, ib->size); 40 | 41 | /* writing the result to stdout */ 42 | (void)fwrite(ob->data, 1, ob->size, stdout); 43 | 44 | /* cleanup */ 45 | hoedown_buffer_free(ib); 46 | hoedown_buffer_free(ob); 47 | 48 | return ferror(stdout); 49 | } 50 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/stack.c: -------------------------------------------------------------------------------- 1 | #include "stack.h" 2 | 3 | #include 4 | 5 | int 6 | hoedown_stack_new(hoedown_stack *st, size_t initial_size) 7 | { 8 | st->item = NULL; 9 | st->size = 0; 10 | st->asize = 0; 11 | 12 | if (!initial_size) 13 | initial_size = 8; 14 | 15 | return hoedown_stack_grow(st, initial_size); 16 | } 17 | 18 | void 19 | hoedown_stack_free(hoedown_stack *st) 20 | { 21 | if (!st) 22 | return; 23 | 24 | free(st->item); 25 | 26 | st->item = NULL; 27 | st->size = 0; 28 | st->asize = 0; 29 | } 30 | 31 | int 32 | hoedown_stack_grow(hoedown_stack *st, size_t new_size) 33 | { 34 | void **new_st; 35 | 36 | if (st->asize >= new_size) 37 | return 0; 38 | 39 | new_st = realloc(st->item, new_size * sizeof(void *)); 40 | if (new_st == NULL) 41 | return -1; 42 | 43 | memset(new_st + st->asize, 0x0, 44 | (new_size - st->asize) * sizeof(void *)); 45 | 46 | st->item = new_st; 47 | st->asize = new_size; 48 | 49 | if (st->size > new_size) 50 | st->size = new_size; 51 | 52 | return 0; 53 | } 54 | 55 | int 56 | hoedown_stack_push(hoedown_stack *st, void *item) 57 | { 58 | if (hoedown_stack_grow(st, st->size * 2) < 0) 59 | return -1; 60 | 61 | st->item[st->size++] = item; 62 | return 0; 63 | } 64 | 65 | void * 66 | hoedown_stack_pop(hoedown_stack *st) 67 | { 68 | if (!st->size) 69 | return NULL; 70 | 71 | return st->item[--st->size]; 72 | } 73 | 74 | void * 75 | hoedown_stack_top(hoedown_stack *st) 76 | { 77 | if (!st->size) 78 | return NULL; 79 | 80 | return st->item[st->size - 1]; 81 | } 82 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/stack.h: -------------------------------------------------------------------------------- 1 | /* stack.h - simple stacking */ 2 | 3 | #ifndef HOEDOWN_STACK_H 4 | #define HOEDOWN_STACK_H 5 | 6 | #include 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | struct hoedown_stack { 13 | void **item; 14 | size_t size; 15 | size_t asize; 16 | }; 17 | 18 | typedef struct hoedown_stack hoedown_stack; 19 | 20 | int hoedown_stack_new(hoedown_stack *, size_t); 21 | void hoedown_stack_free(hoedown_stack *); 22 | int hoedown_stack_grow(hoedown_stack *, size_t); 23 | int hoedown_stack_push(hoedown_stack *, void *); 24 | void *hoedown_stack_pop(hoedown_stack *); 25 | void *hoedown_stack_top(hoedown_stack *); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | #endif /** HOEDOWN_STACK_H **/ 32 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Amps and angle encoding.html: -------------------------------------------------------------------------------- 1 |

AT&T has an ampersand in their name.

2 | 3 |

AT&T is another way to write it.

4 | 5 |

This & that.

6 | 7 |

4 < 5.

8 | 9 |

6 > 5.

10 | 11 |

Here's a link with an ampersand in the URL.

12 | 13 |

Here's a link with an amersand in the link text: AT&T.

14 | 15 |

Here's an inline link.

16 | 17 |

Here's an inline link.

18 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Amps and angle encoding.text: -------------------------------------------------------------------------------- 1 | AT&T has an ampersand in their name. 2 | 3 | AT&T is another way to write it. 4 | 5 | This & that. 6 | 7 | 4 < 5. 8 | 9 | 6 > 5. 10 | 11 | Here's a [link] [1] with an ampersand in the URL. 12 | 13 | Here's a link with an amersand in the link text: [AT&T] [2]. 14 | 15 | Here's an inline [link](/script?foo=1&bar=2). 16 | 17 | Here's an inline [link](). 18 | 19 | 20 | [1]: http://example.com/?foo=1&bar=2 21 | [2]: http://att.com/ "AT&T" -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Auto links.html: -------------------------------------------------------------------------------- 1 |

Link: http://example.com/.

2 | 3 |

With an ampersand: http://example.com/?foo=1&bar=2

4 | 5 | 10 | 11 |
12 |

Blockquoted: http://example.com/

13 |
14 | 15 |

Auto-links should not occur here: <http://example.com/>

16 | 17 |
or here: <http://example.com/>
18 | 
19 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Auto links.text: -------------------------------------------------------------------------------- 1 | Link: . 2 | 3 | With an ampersand: 4 | 5 | * In a list? 6 | * 7 | * It should. 8 | 9 | > Blockquoted: 10 | 11 | Auto-links should not occur here: `` 12 | 13 | or here: -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Blockquotes with code blocks.html: -------------------------------------------------------------------------------- 1 |
2 |

Example:

3 | 4 |
sub status {
 5 |     print "working";
 6 | }
 7 | 
8 | 9 |

Or:

10 | 11 |
sub status {
12 |     return "working";
13 | }
14 | 
15 |
16 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Blockquotes with code blocks.text: -------------------------------------------------------------------------------- 1 | > Example: 2 | > 3 | > sub status { 4 | > print "working"; 5 | > } 6 | > 7 | > Or: 8 | > 9 | > sub status { 10 | > return "working"; 11 | > } 12 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Code Blocks.html: -------------------------------------------------------------------------------- 1 |
code block on the first line
 2 | 
3 | 4 |

Regular text.

5 | 6 |
code block indented by spaces
 7 | 
8 | 9 |

Regular text.

10 | 11 |
the lines in this block  
12 | all contain trailing spaces  
13 | 
14 | 15 |

Regular Text.

16 | 17 |
code block on the last line
18 | 
19 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Code Blocks.text: -------------------------------------------------------------------------------- 1 | code block on the first line 2 | 3 | Regular text. 4 | 5 | code block indented by spaces 6 | 7 | Regular text. 8 | 9 | the lines in this block 10 | all contain trailing spaces 11 | 12 | Regular Text. 13 | 14 | code block on the last line -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Code Spans.html: -------------------------------------------------------------------------------- 1 |

<test a=" content of attribute ">

2 | 3 |

Fix for backticks within HTML tag: like this

4 | 5 |

Here's how you put `backticks` in a code span.

6 | 7 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Code Spans.text: -------------------------------------------------------------------------------- 1 | `` 2 | 3 | Fix for backticks within HTML tag: like this 4 | 5 | Here's how you put `` `backticks` `` in a code span. 6 | 7 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Hard-wrapped paragraphs with list-like lines.html: -------------------------------------------------------------------------------- 1 |

In Markdown 1.0.0 and earlier. Version 2 | 8. This line turns into a list item. 3 | Because a hard-wrapped line in the 4 | middle of a paragraph looked like a 5 | list item.

6 | 7 |

Here's one with a bullet. 8 | * criminey.

9 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Hard-wrapped paragraphs with list-like lines.text: -------------------------------------------------------------------------------- 1 | In Markdown 1.0.0 and earlier. Version 2 | 8. This line turns into a list item. 3 | Because a hard-wrapped line in the 4 | middle of a paragraph looked like a 5 | list item. 6 | 7 | Here's one with a bullet. 8 | * criminey. 9 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Horizontal rules.html: -------------------------------------------------------------------------------- 1 |

Dashes:

2 | 3 |
4 | 5 |
6 | 7 |
8 | 9 |
10 | 11 |
---
12 | 
13 | 14 |
15 | 16 |
17 | 18 |
19 | 20 |
21 | 22 |
- - -
23 | 
24 | 25 |

Asterisks:

26 | 27 |
28 | 29 |
30 | 31 |
32 | 33 |
34 | 35 |
***
36 | 
37 | 38 |
39 | 40 |
41 | 42 |
43 | 44 |
45 | 46 |
* * *
47 | 
48 | 49 |

Underscores:

50 | 51 |
52 | 53 |
54 | 55 |
56 | 57 |
58 | 59 |
___
60 | 
61 | 62 |
63 | 64 |
65 | 66 |
67 | 68 |
69 | 70 |
_ _ _
71 | 
72 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Horizontal rules.text: -------------------------------------------------------------------------------- 1 | Dashes: 2 | 3 | --- 4 | 5 | --- 6 | 7 | --- 8 | 9 | --- 10 | 11 | --- 12 | 13 | - - - 14 | 15 | - - - 16 | 17 | - - - 18 | 19 | - - - 20 | 21 | - - - 22 | 23 | 24 | Asterisks: 25 | 26 | *** 27 | 28 | *** 29 | 30 | *** 31 | 32 | *** 33 | 34 | *** 35 | 36 | * * * 37 | 38 | * * * 39 | 40 | * * * 41 | 42 | * * * 43 | 44 | * * * 45 | 46 | 47 | Underscores: 48 | 49 | ___ 50 | 51 | ___ 52 | 53 | ___ 54 | 55 | ___ 56 | 57 | ___ 58 | 59 | _ _ _ 60 | 61 | _ _ _ 62 | 63 | _ _ _ 64 | 65 | _ _ _ 66 | 67 | _ _ _ 68 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Inline HTML (Advanced).html: -------------------------------------------------------------------------------- 1 |

Simple block on one line:

2 | 3 |
foo
4 | 5 |

And nested without indentation:

6 | 7 |
8 |
9 |
10 | foo 11 |
12 |
13 |
14 |
bar
15 |
16 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Inline HTML (Advanced).text: -------------------------------------------------------------------------------- 1 | Simple block on one line: 2 | 3 |
foo
4 | 5 | And nested without indentation: 6 | 7 |
8 |
9 |
10 | foo 11 |
12 |
13 |
14 |
bar
15 |
16 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Inline HTML (Simple).html: -------------------------------------------------------------------------------- 1 |

Here's a simple block:

2 | 3 |
4 | foo 5 |
6 | 7 |

This should be a code block, though:

8 | 9 |
<div>
10 |     foo
11 | </div>
12 | 
13 | 14 |

As should this:

15 | 16 |
<div>foo</div>
17 | 
18 | 19 |

Now, nested:

20 | 21 |
22 |
23 |
24 | foo 25 |
26 |
27 |
28 | 29 |

This should just be an HTML comment:

30 | 31 | 32 | 33 |

Multiline:

34 | 35 | 39 | 40 |

Code block:

41 | 42 |
<!-- Comment -->
43 | 
44 | 45 |

Just plain comment, with trailing spaces on the line:

46 | 47 | 48 | 49 |

Code:

50 | 51 |
<hr />
52 | 
53 | 54 |

Hr's:

55 | 56 |
57 | 58 |
59 | 60 |
61 | 62 |
63 | 64 |
65 | 66 |
67 | 68 |
69 | 70 |
71 | 72 |
73 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Inline HTML (Simple).text: -------------------------------------------------------------------------------- 1 | Here's a simple block: 2 | 3 |
4 | foo 5 |
6 | 7 | This should be a code block, though: 8 | 9 |
10 | foo 11 |
12 | 13 | As should this: 14 | 15 |
foo
16 | 17 | Now, nested: 18 | 19 |
20 |
21 |
22 | foo 23 |
24 |
25 |
26 | 27 | This should just be an HTML comment: 28 | 29 | 30 | 31 | Multiline: 32 | 33 | 37 | 38 | Code block: 39 | 40 | 41 | 42 | Just plain comment, with trailing spaces on the line: 43 | 44 | 45 | 46 | Code: 47 | 48 |
49 | 50 | Hr's: 51 | 52 |
53 | 54 |
55 | 56 |
57 | 58 |
59 | 60 |
61 | 62 |
63 | 64 |
65 | 66 |
67 | 68 |
69 | 70 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Inline HTML comments.html: -------------------------------------------------------------------------------- 1 |

Paragraph one.

2 | 3 | 4 | 5 | 8 | 9 |

Paragraph two.

10 | 11 | 12 | 13 |

The end.

14 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Inline HTML comments.text: -------------------------------------------------------------------------------- 1 | Paragraph one. 2 | 3 | 4 | 5 | 8 | 9 | Paragraph two. 10 | 11 | 12 | 13 | The end. 14 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Links, inline style.html: -------------------------------------------------------------------------------- 1 |

Just a URL.

2 | 3 |

URL and title.

4 | 5 |

URL and title.

6 | 7 |

URL and title.

8 | 9 |

URL and title.

10 | 11 |

Empty.

12 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Links, inline style.text: -------------------------------------------------------------------------------- 1 | Just a [URL](/url/). 2 | 3 | [URL and title](/url/ "title"). 4 | 5 | [URL and title](/url/ "title preceded by two spaces"). 6 | 7 | [URL and title](/url/ "title preceded by a tab"). 8 | 9 | [URL and title](/url/ "title has spaces afterward" ). 10 | 11 | 12 | [Empty](). 13 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Links, reference style.html: -------------------------------------------------------------------------------- 1 |

Foo bar.

2 | 3 |

Foo bar.

4 | 5 |

Foo bar.

6 | 7 |

With embedded [brackets].

8 | 9 |

Indented once.

10 | 11 |

Indented twice.

12 | 13 |

Indented thrice.

14 | 15 |

Indented [four][] times.

16 | 17 |
[four]: /url
18 | 
19 | 20 |
21 | 22 |

this should work

23 | 24 |

So should this.

25 | 26 |

And this.

27 | 28 |

And this.

29 | 30 |

And this.

31 | 32 |

But not [that] [].

33 | 34 |

Nor [that][].

35 | 36 |

Nor [that].

37 | 38 |

[Something in brackets like this should work]

39 | 40 |

[Same with this.]

41 | 42 |

In this case, this points to something else.

43 | 44 |

Backslashing should suppress [this] and [this].

45 | 46 |
47 | 48 |

Here's one where the link 49 | breaks across lines.

50 | 51 |

Here's another where the link 52 | breaks across lines, but with a line-ending space.

53 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Links, reference style.text: -------------------------------------------------------------------------------- 1 | Foo [bar] [1]. 2 | 3 | Foo [bar][1]. 4 | 5 | Foo [bar] 6 | [1]. 7 | 8 | [1]: /url/ "Title" 9 | 10 | 11 | With [embedded [brackets]] [b]. 12 | 13 | 14 | Indented [once][]. 15 | 16 | Indented [twice][]. 17 | 18 | Indented [thrice][]. 19 | 20 | Indented [four][] times. 21 | 22 | [once]: /url 23 | 24 | [twice]: /url 25 | 26 | [thrice]: /url 27 | 28 | [four]: /url 29 | 30 | 31 | [b]: /url/ 32 | 33 | * * * 34 | 35 | [this] [this] should work 36 | 37 | So should [this][this]. 38 | 39 | And [this] []. 40 | 41 | And [this][]. 42 | 43 | And [this]. 44 | 45 | But not [that] []. 46 | 47 | Nor [that][]. 48 | 49 | Nor [that]. 50 | 51 | [Something in brackets like [this][] should work] 52 | 53 | [Same with [this].] 54 | 55 | In this case, [this](/somethingelse/) points to something else. 56 | 57 | Backslashing should suppress \[this] and [this\]. 58 | 59 | [this]: foo 60 | 61 | 62 | * * * 63 | 64 | Here's one where the [link 65 | breaks] across lines. 66 | 67 | Here's another where the [link 68 | breaks] across lines, but with a line-ending space. 69 | 70 | 71 | [link breaks]: /url/ 72 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Links, shortcut references.html: -------------------------------------------------------------------------------- 1 |

This is the simple case.

2 | 3 |

This one has a line 4 | break.

5 | 6 |

This one has a line 7 | break with a line-ending space.

8 | 9 |

this and the other

10 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Links, shortcut references.text: -------------------------------------------------------------------------------- 1 | This is the [simple case]. 2 | 3 | [simple case]: /simple 4 | 5 | 6 | 7 | This one has a [line 8 | break]. 9 | 10 | This one has a [line 11 | break] with a line-ending space. 12 | 13 | [line break]: /foo 14 | 15 | 16 | [this] [that] and the [other] 17 | 18 | [this]: /this 19 | [that]: /that 20 | [other]: /other 21 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Literal quotes in titles.html: -------------------------------------------------------------------------------- 1 |

Foo bar.

2 | 3 |

Foo bar.

4 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Literal quotes in titles.text: -------------------------------------------------------------------------------- 1 | Foo [bar][]. 2 | 3 | Foo [bar](/url/ "Title with "quotes" inside"). 4 | 5 | 6 | [bar]: /url/ "Title with "quotes" inside" 7 | 8 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Nested blockquotes.html: -------------------------------------------------------------------------------- 1 |
2 |

foo

3 | 4 |
5 |

bar

6 |
7 | 8 |

foo

9 |
10 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Nested blockquotes.text: -------------------------------------------------------------------------------- 1 | > foo 2 | > 3 | > > bar 4 | > 5 | > foo 6 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Ordered and unordered lists.text: -------------------------------------------------------------------------------- 1 | ## Unordered 2 | 3 | Asterisks tight: 4 | 5 | * asterisk 1 6 | * asterisk 2 7 | * asterisk 3 8 | 9 | 10 | Asterisks loose: 11 | 12 | * asterisk 1 13 | 14 | * asterisk 2 15 | 16 | * asterisk 3 17 | 18 | * * * 19 | 20 | Pluses tight: 21 | 22 | + Plus 1 23 | + Plus 2 24 | + Plus 3 25 | 26 | 27 | Pluses loose: 28 | 29 | + Plus 1 30 | 31 | + Plus 2 32 | 33 | + Plus 3 34 | 35 | * * * 36 | 37 | 38 | Minuses tight: 39 | 40 | - Minus 1 41 | - Minus 2 42 | - Minus 3 43 | 44 | 45 | Minuses loose: 46 | 47 | - Minus 1 48 | 49 | - Minus 2 50 | 51 | - Minus 3 52 | 53 | 54 | ## Ordered 55 | 56 | Tight: 57 | 58 | 1. First 59 | 2. Second 60 | 3. Third 61 | 62 | and: 63 | 64 | 1. One 65 | 2. Two 66 | 3. Three 67 | 68 | 69 | Loose using tabs: 70 | 71 | 1. First 72 | 73 | 2. Second 74 | 75 | 3. Third 76 | 77 | and using spaces: 78 | 79 | 1. One 80 | 81 | 2. Two 82 | 83 | 3. Three 84 | 85 | Multiple paragraphs: 86 | 87 | 1. Item 1, graf one. 88 | 89 | Item 2. graf two. The quick brown fox jumped over the lazy dog's 90 | back. 91 | 92 | 2. Item 2. 93 | 94 | 3. Item 3. 95 | 96 | 97 | 98 | ## Nested 99 | 100 | * Tab 101 | * Tab 102 | * Tab 103 | 104 | Here's another: 105 | 106 | 1. First 107 | 2. Second: 108 | * Fee 109 | * Fie 110 | * Foe 111 | 3. Third 112 | 113 | Same thing but with paragraphs: 114 | 115 | 1. First 116 | 117 | 2. Second: 118 | * Fee 119 | * Fie 120 | * Foe 121 | 122 | 3. Third 123 | 124 | 125 | This was an error in Markdown 1.0.1: 126 | 127 | * this 128 | 129 | * sub 130 | 131 | that 132 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Strong and em together.html: -------------------------------------------------------------------------------- 1 |

This is strong and em.

2 | 3 |

So is this word.

4 | 5 |

This is strong and em.

6 | 7 |

So is this word.

8 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Strong and em together.text: -------------------------------------------------------------------------------- 1 | ***This is strong and em.*** 2 | 3 | So is ***this*** word. 4 | 5 | ___This is strong and em.___ 6 | 7 | So is ___this___ word. 8 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Tabs.html: -------------------------------------------------------------------------------- 1 |
    2 |
  • this is a list item 3 | indented with tabs

  • 4 |
  • this is a list item 5 | indented with spaces

  • 6 |
7 | 8 |

Code:

9 | 10 |
this code block is indented by one tab
11 | 
12 | 13 |

And:

14 | 15 |
    this code block is indented by two tabs
16 | 
17 | 18 |

And:

19 | 20 |
+   this is an example list item
21 |     indented with tabs
22 | 
23 | +   this is an example list item
24 |     indented with spaces
25 | 
26 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Tabs.text: -------------------------------------------------------------------------------- 1 | + this is a list item 2 | indented with tabs 3 | 4 | + this is a list item 5 | indented with spaces 6 | 7 | Code: 8 | 9 | this code block is indented by one tab 10 | 11 | And: 12 | 13 | this code block is indented by two tabs 14 | 15 | And: 16 | 17 | + this is an example list item 18 | indented with tabs 19 | 20 | + this is an example list item 21 | indented with spaces 22 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Tidyness.html: -------------------------------------------------------------------------------- 1 |
2 |

A list within a blockquote:

3 |
    4 |
  • asterisk 1
  • 5 |
  • asterisk 2
  • 6 |
  • asterisk 3
  • 7 |
8 |
9 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/hoedown/test/MarkdownTest_1.0.3/Tests/Tidyness.text: -------------------------------------------------------------------------------- 1 | > A list within a blockquote: 2 | > 3 | > * asterisk 1 4 | > * asterisk 2 5 | > * asterisk 3 6 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/lib/Text/Markdown/Hoedown/Markdown.pod: -------------------------------------------------------------------------------- 1 | =head1 NAME 2 | 3 | Text::Markdown::Hoedown::Markdown - markdown 4 | 5 | =head1 DESCRIPTION 6 | 7 | Note. Any API will change without notice. 8 | 9 | =head1 METHODS 10 | 11 | =over 4 12 | 13 | =item C<< my $md = Text::Markdown::Hoedown::Markdown->new($extensions:UV, $max_nesting:UV, $callbacks:Text::Markdown::Hoedown::Renderer::*); >> 14 | 15 | Create new instance. 16 | 17 | I<$extensions> is the bit flags, listed on L. 18 | 19 | I<$max_nesting> is the max nesting level. 20 | 21 | I<$callbacks> is the callback object. It's instance of L. 22 | 23 | =item C<< my $src = $md->render($src:Str); >> 24 | 25 | Render the markdown. 26 | 27 | =back 28 | 29 | =head1 SEE ALSO 30 | 31 | L 32 | 33 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/t/00_compile.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use Test::More; 3 | 4 | use_ok $_ for qw( 5 | Text::Markdown::Hoedown 6 | ); 7 | 8 | done_testing; 9 | 10 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/t/01_simple.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use Test::More; 3 | 4 | use Text::Markdown::Hoedown; 5 | use Encode; 6 | 7 | ok HOEDOWN_EXT_NO_INTRA_EMPHASIS; 8 | 9 | isa_ok(Text::Markdown::Hoedown::Renderer::HTML->new(0,0), 'Text::Markdown::Hoedown::Renderer::HTML'); 10 | is(markdown("# foo"), qq{

foo

\n}); 11 | { 12 | use utf8; 13 | my $aiu = markdown("# あいう"); 14 | ok Encode::is_utf8($aiu); 15 | is($aiu, qq{

あいう

\n}); 16 | } 17 | 18 | is(markdown("http://mixi.jp", extensions => HOEDOWN_EXT_AUTOLINK), qq{

http://mixi.jp

\n}); 19 | 20 | done_testing; 21 | 22 | -------------------------------------------------------------------------------- /modules/Text-Markdown-Hoedown-1.01/t/02_toc.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use Test::More; 3 | 4 | use Text::Markdown::Hoedown; 5 | 6 | my $src = <<'...'; 7 | # 1 8 | ## 1.1 9 | ### 1.1.1 10 | ## 1.2 11 | ### 1.2.1 12 | # 2 13 | ## 2.2 14 | ... 15 | 16 | is(markdown_toc($src), <<'...'); 17 |
    18 |
  • 19 | 1 20 |
      21 |
    • 22 | 1.1 23 |
        24 |
      • 25 | 1.1.1 26 |
      • 27 |
      28 |
    • 29 |
    • 30 | 1.2 31 |
        32 |
      • 33 | 1.2.1 34 |
      • 35 |
      36 |
    • 37 |
    38 |
  • 39 |
  • 40 | 2 41 |
      42 |
    • 43 | 2.2 44 |
    • 45 |
    46 |
  • 47 |
48 | ... 49 | 50 | is(markdown($src, html_options => HOEDOWN_HTML_TOC), <<'...'); 51 |

1

52 | 53 |

1.1

54 | 55 |

1.1.1

56 | 57 |

1.2

58 | 59 |

1.2.1

60 | 61 |

2

62 | 63 |

2.2

64 | ... 65 | 66 | done_testing; 67 | 68 | -------------------------------------------------------------------------------- /modules/UnQLite-0.05/Changes: -------------------------------------------------------------------------------- 1 | Revision history for Perl extension Unqlite 2 | 3 | 0.05 2014-12-23T22:55:15Z 4 | 5 | - Doc fix 6 | 7 | 0.04 2014-08-30T09:33:52Z 8 | 9 | - Fixed packaging issue. 10 | 11 | 0.03 2013-07-18T03:14:07Z 12 | 13 | - more OPEN consts as mode argument 14 | we do not only want to create databases 15 | (Reini Urban) 16 | 17 | 0.02 2013-07-05T06:42:59Z 18 | 19 | - Store RC to magic to fix race condition 20 | (charsbar) 21 | - Added `tie` interface. 22 | (charsbar) 23 | 24 | 0.01 2013-07-03T19:02:44Z 25 | 26 | - original version 27 | 28 | -------------------------------------------------------------------------------- /modules/UnQLite-0.05/MANIFEST: -------------------------------------------------------------------------------- 1 | Changes 2 | cpanfile 3 | lib/UnQLite.pm 4 | LICENSE 5 | Makefile.PL 6 | MANIFEST This list of files 7 | ppport.h 8 | README 9 | README.md 10 | t/00_compile.t 11 | t/01_simple.t 12 | t/02_cursor.t 13 | t/03_tie.t 14 | UnQLite.xs 15 | unqlite/license.txt 16 | unqlite/Makefile.PL 17 | unqlite/unqlite.c 18 | unqlite/unqlite.h 19 | META.yml Module YAML meta-data (added by MakeMaker) 20 | META.json Module JSON meta-data (added by MakeMaker) 21 | -------------------------------------------------------------------------------- /modules/UnQLite-0.05/META.json: -------------------------------------------------------------------------------- 1 | { 2 | "abstract" : "Perl bindings for UnQLite", 3 | "author" : [ 4 | "tokuhirom tokuhirom@gmail.com" 5 | ], 6 | "dynamic_config" : 1, 7 | "generated_by" : "ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter version 2.150001", 8 | "license" : [ 9 | "artistic_2" 10 | ], 11 | "meta-spec" : { 12 | "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", 13 | "version" : "2" 14 | }, 15 | "name" : "UnQLite", 16 | "no_index" : { 17 | "directory" : [ 18 | "t", 19 | "inc" 20 | ] 21 | }, 22 | "prereqs" : { 23 | "build" : { 24 | "requires" : { 25 | "ExtUtils::MakeMaker" : "0", 26 | "Test::More" : "0.98" 27 | } 28 | }, 29 | "configure" : { 30 | "requires" : { 31 | "ExtUtils::MakeMaker" : "0" 32 | } 33 | }, 34 | "runtime" : { 35 | "requires" : {} 36 | } 37 | }, 38 | "release_status" : "stable", 39 | "version" : "0.05" 40 | } 41 | -------------------------------------------------------------------------------- /modules/UnQLite-0.05/META.yml: -------------------------------------------------------------------------------- 1 | --- 2 | abstract: 'Perl bindings for UnQLite' 3 | author: 4 | - 'tokuhirom tokuhirom@gmail.com' 5 | build_requires: 6 | ExtUtils::MakeMaker: '0' 7 | Test::More: '0.98' 8 | configure_requires: 9 | ExtUtils::MakeMaker: '0' 10 | dynamic_config: 1 11 | generated_by: 'ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter version 2.150001' 12 | license: artistic_2 13 | meta-spec: 14 | url: http://module-build.sourceforge.net/META-spec-v1.4.html 15 | version: '1.4' 16 | name: UnQLite 17 | no_index: 18 | directory: 19 | - t 20 | - inc 21 | requires: {} 22 | version: '0.05' 23 | -------------------------------------------------------------------------------- /modules/UnQLite-0.05/Makefile.PL: -------------------------------------------------------------------------------- 1 | use ExtUtils::MakeMaker; 2 | use Config; 3 | 4 | my $myextlib = 'unqlite/libunqlite$(LIB_EXT)'; 5 | 6 | WriteMakefile( 7 | dist => { 8 | PREOP => 'pod2text lib/UnQLite.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', 9 | COMPRESS => 'gzip -9v', 10 | SUFFIX => '.gz', 11 | }, 12 | NAME => 'UnQLite', 13 | VERSION_FROM => 'lib/UnQLite.pm', 14 | ABSTRACT => 'Perl bindings for UnQLite', 15 | AUTHOR => 'tokuhirom tokuhirom@gmail.com', 16 | LICENSE => 'artistic_2', 17 | TEST_REQUIRES => { 18 | 'Test::More' => '0.98', 19 | }, 20 | INC => '-Iunqlite', 21 | MYEXTLIB => $myextlib, 22 | ); 23 | 24 | # We don't want the default subdir rule, as it creates a race condition with the 25 | # rule we add below. 26 | sub MY::subdir_x { 27 | return ''; 28 | } 29 | 30 | sub MY::postamble { 31 | return <<'EOT'; 32 | $(MYEXTLIB): unqlite/Makefile 33 | cd unqlite && $(MAKE) all 34 | EOT 35 | } 36 | -------------------------------------------------------------------------------- /modules/UnQLite-0.05/cpanfile: -------------------------------------------------------------------------------- 1 | requires 'perl', '5.008001'; 2 | 3 | on 'test' => sub { 4 | requires 'Test::More', '0.98'; 5 | }; 6 | 7 | -------------------------------------------------------------------------------- /modules/UnQLite-0.05/t/00_compile.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use Test::More; 3 | 4 | use_ok $_ for qw( 5 | UnQLite 6 | ); 7 | 8 | done_testing; 9 | 10 | -------------------------------------------------------------------------------- /modules/UnQLite-0.05/t/01_simple.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use Test::More; 3 | 4 | use File::Temp qw(tempdir); 5 | use UnQLite; 6 | 7 | my $tmp = tempdir( CLEANUP => 1 ); 8 | 9 | { 10 | my $db = UnQLite->open("$tmp/foo.db"); 11 | isa_ok($db, 'UnQLite'); 12 | 13 | ok($db->kv_store("foo", "bar")); 14 | is($db->kv_fetch('foo'), 'bar'); 15 | ok($db->kv_delete('foo')); 16 | is($db->kv_fetch('foo'), undef); 17 | $db->kv_store('yay', 'yap'); 18 | $db->kv_append('yay', 'po'); 19 | is($db->kv_fetch('yay'), 'yappo'); 20 | is($db->rc,0); 21 | } 22 | 23 | my $db = UnQLite->open("/path/to/unexisted/file"); 24 | is($db->kv_fetch('x'), undef); 25 | isnt($db->rc, 0); 26 | note $db->errstr; 27 | 28 | done_testing; 29 | 30 | -------------------------------------------------------------------------------- /modules/UnQLite-0.05/t/02_cursor.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use Test::More; 3 | 4 | use File::Temp qw(tempdir); 5 | use UnQLite; 6 | 7 | my $tmp = tempdir( CLEANUP => 1 ); 8 | 9 | my $db = UnQLite->open("$tmp/foo.db"); 10 | { 11 | isa_ok($db, 'UnQLite'); 12 | 13 | ok($db->kv_store("foo", "bar")); 14 | ok($db->kv_store("hoge", "fuga")); 15 | } 16 | 17 | { 18 | my $cursor = $db->cursor_init(); 19 | $cursor->first_entry; 20 | is($cursor->valid_entry(), 1); 21 | is($cursor->key(), 'hoge'); 22 | is($cursor->data(), 'fuga'); 23 | ok($cursor->next_entry()); 24 | is($cursor->valid_entry(), 1); 25 | is($cursor->key(), 'foo'); 26 | is($cursor->data(), 'bar'); 27 | ok(!$cursor->next_entry()); 28 | is($cursor->valid_entry(), 0); 29 | } 30 | 31 | { 32 | my $cursor = $db->cursor_init(); 33 | my @ret; 34 | for ($cursor->first_entry; $cursor->valid_entry; $cursor->next_entry) { 35 | push @ret, $cursor->key(), $cursor->data() 36 | } 37 | is_deeply(\@ret, [qw(hoge fuga foo bar)]); 38 | } 39 | 40 | { 41 | my $cursor = $db->cursor_init(); 42 | $cursor->last_entry; 43 | is($cursor->valid_entry(), 1); 44 | is($cursor->key(), 'foo'); 45 | is($cursor->data(), 'bar'); 46 | ok($cursor->prev_entry()); 47 | is($cursor->valid_entry(), 1); 48 | is($cursor->key(), 'hoge'); 49 | is($cursor->data(), 'fuga'); 50 | ok(!$cursor->prev_entry()); 51 | is($cursor->valid_entry(), 0); 52 | } 53 | 54 | { 55 | my $cursor = $db->cursor_init(); 56 | ok(!$cursor->seek("NON EXISTENT")); 57 | ok($cursor->seek("foo")); 58 | is($cursor->valid_entry(), 1); 59 | $cursor->delete_entry(); 60 | } 61 | 62 | done_testing; 63 | 64 | -------------------------------------------------------------------------------- /modules/UnQLite-0.05/t/03_tie.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use Test::More; 3 | 4 | use File::Temp qw(tempdir); 5 | use UnQLite; 6 | 7 | my $tmp = tempdir( CLEANUP => 1 ); 8 | 9 | { 10 | my $db = UnQLite->open("$tmp/foo.db"); 11 | isa_ok($db, 'UnQLite'); 12 | 13 | ok($db->kv_store("foo", "bar")); 14 | is($db->kv_fetch('foo'), 'bar'); 15 | ok($db->kv_delete('foo')); 16 | is($db->kv_fetch('foo'), undef); 17 | $db->kv_store('yay', 'yap'); 18 | $db->kv_append('yay', 'po'); 19 | is($db->kv_fetch('yay'), 'yappo'); 20 | is($db->rc,0); 21 | } 22 | 23 | { 24 | ok -e "$tmp/foo.db", "foo.db exists"; 25 | tie my %hash, 'UnQLite', "$tmp/foo.db"; 26 | 27 | # stored data can be retrieved again? 28 | is($hash{yay}, 'yappo'); 29 | $hash{foo} = 'baz'; 30 | is($hash{foo}, 'baz'); 31 | $hash{delete} = 'delete'; 32 | is(delete $hash{delete}, 'delete'); 33 | is(delete $hash{delete}, undef); 34 | ok(exists $hash{foo}); 35 | ok(!exists $hash{delete}); 36 | 37 | is(join(" ", sort keys %hash), "foo yay"); 38 | is(join(" ", sort values %hash), "baz yappo"); 39 | is(scalar %hash, 2); 40 | %hash = (); 41 | is(join(" ", sort keys %hash), ""); 42 | is(join(" ", sort values %hash), ""); 43 | is(scalar %hash, undef); 44 | } 45 | 46 | done_testing; 47 | -------------------------------------------------------------------------------- /modules/UnQLite-0.05/unqlite/Makefile.PL: -------------------------------------------------------------------------------- 1 | use ExtUtils::MakeMaker; 2 | 3 | WriteMakefile( 4 | NAME => 'unqlite', 5 | INC => '-I$(PERL_INC)', 6 | SKIP => [qw(dynamic dynamic_lib dlsyms)], 7 | OBJECT => '$(O_FILES)', 8 | clean => {'FILES' => 'libunqlite.a'}, 9 | H => [qw(unqlite.h $(PERL_INC)/config.h)], 10 | C => [qw(unqlite.c)], 11 | NO_MYMETA => 1, 12 | ); 13 | 14 | sub MY::constants { 15 | package MY; 16 | my $self = shift; 17 | 18 | $self->{INST_STATIC} = 'libunqlite$(LIB_EXT)'; 19 | 20 | return $self->SUPER::constants(); 21 | } 22 | 23 | sub MY::top_targets { 24 | my $r = ' 25 | all :: static 26 | $(NOECHO) $(NOOP) 27 | 28 | config :: 29 | $(NOECHO) $(NOOP) 30 | 31 | lint: 32 | lint -abchx $(LIBSRCS) 33 | 34 | pure_all :: all 35 | $(NOECHO) $(NOOP) 36 | 37 | '; 38 | $r .= ' 39 | # This is a workaround, the problem is that our old GNU make exports 40 | # variables into the environment so $(MYEXTLIB) is set in here to this 41 | # value which can not be built. 42 | unqlite/libunqlite.a: 43 | $(NOECHO) $(NOOP) 44 | ' unless $^O eq 'VMS'; 45 | 46 | return $r; 47 | } 48 | -------------------------------------------------------------------------------- /modules/UnQLite-0.05/unqlite/license.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012, 2013 Symisc Systems, S.U.A.R.L [M.I.A.G Mrad Chems Eddine ]. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY SYMISC SYSTEMS ``AS IS'' AND ANY EXPRESS 15 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR 17 | * NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL SYMISC SYSTEMS 18 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 21 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 23 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 24 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | -------------------------------------------------------------------------------- /patches/AnyEvent-Fork-Pool/0001-Pool.diff: -------------------------------------------------------------------------------- 1 | --- Pool.pm.orig 2014-08-15 12:17:42.551688017 +0400 2 | +++ Pool.pm 2014-08-15 12:19:47.231687946 +0400 3 | @@ -481,19 +481,26 @@ 4 | BEGIN { 5 | if ($^O eq "linux") { 6 | *ncpu = sub(;$) { 7 | - my ($cpus, $eus); 8 | + my ($cpus, $eus) = (0, 0); 9 | 10 | if (open my $fh, "<", "/proc/cpuinfo") { 11 | my %id; 12 | + my $unit; 13 | 14 | while (<$fh>) { 15 | - if (/^core id\s*:\s*(\d+)/) { 16 | - ++$eus; 17 | - undef $id{$1}; 18 | - } 19 | + if (/^physical id\s*:\s*(\d+)/) { 20 | + $unit = $1; 21 | + } 22 | + elsif (/^core id\s*:\s*(\d+)/) { 23 | + defined $unit && $id{$unit}++; 24 | + undef $unit; 25 | + } 26 | } 27 | 28 | $cpus = scalar keys %id; 29 | + $eus += $_ for (values %id); 30 | + 31 | + close $fh; 32 | } else { 33 | $cpus = $eus = @_ ? shift : 1; 34 | } 35 | -------------------------------------------------------------------------------- /patches/AnyEvent-Fork/rt100561.diff: -------------------------------------------------------------------------------- 1 | --- Fork.pm.orig 2 | +++ Fork.pm 3 | @@ -627,7 +627,7 @@ 4 | 5 | unless (defined $PERL) { 6 | # first find path of perl 7 | - my $perl = $; 8 | + my $perl = $^X; # RT #100561 9 | 10 | # first we try $^X, but the path must be absolute (always on win32), and end in sth. 11 | # that looks like perl. this obviously only works for posix and win32 12 | -------------------------------------------------------------------------------- /patches/Async-Interrupt/0001-schmorp.h-Win32.diff: -------------------------------------------------------------------------------- 1 | --- schmorp.h.orig Fri Apr 11 08:24:10 2014 2 | +++ schmorp.h Sun Oct 18 05:47:56 2015 3 | @@ -306,12 +306,13 @@ 4 | 5 | closesocket (listener); 6 | 7 | -#ifdef USE_SOCKETS_AS_HANDLES 8 | +#if defined(USE_SOCKETS_AS_HANDLES) || defined(WIN32) 9 | /* when select isn't winsocket, we also expect socket, connect, accept etc. 10 | * to work on fds */ 11 | filedes [0] = sock [0]; 12 | filedes [1] = sock [1]; 13 | #else 14 | +/* Visual C++ only. Does not working with gcc (strawberry 5.22.0) */ 15 | filedes [0] = _open_osfhandle (sock [0], 0); 16 | filedes [1] = _open_osfhandle (sock [1], 0); 17 | #endif 18 | -------------------------------------------------------------------------------- /patches/Digest-MD6/0001-inc-Devel-CheckLib.pm.diff: -------------------------------------------------------------------------------- 1 | --- inc/Devel/CheckLib.pm.orig 2015-10-15 22:19:03.000000000 +0300 2 | +++ inc/Devel/CheckLib.pm 2015-10-15 22:19:46.000000000 +0300 3 | @@ -161,7 +161,7 @@ 4 | # work-a-like for Makefile.PL's LIBS and INC arguments 5 | # if given as command-line argument, append to %args 6 | for my $arg (@ARGV) { 7 | - for my $mm_attr_key qw(LIBS INC) { 8 | + for my $mm_attr_key ( qw(LIBS INC) ) { 9 | if (my ($mm_attr_value) = $arg =~ /\A $mm_attr_key = (.*)/x) { 10 | # it is tempting to put some \s* into the expression, but the 11 | # MM command-line parser only accepts LIBS etc. followed by =, 12 | -------------------------------------------------------------------------------- /patches/Digest-MD6/0002-kat_mct.t.diff: -------------------------------------------------------------------------------- 1 | --- t/kat_mct.t.orig 2015-10-15 22:20:23.000000000 +0300 2 | +++ t/kat_mct.t 2015-10-15 22:29:54.000000000 +0300 3 | @@ -3,11 +3,14 @@ 4 | use strict; 5 | use warnings; 6 | 7 | +use Test::More; 8 | + 9 | use Digest::MD6; 10 | use File::Spec; 11 | -use LWP::Simple qw( mirror is_success status_message $ua ); 12 | 13 | -use Test::More; 14 | +eval 'use LWP::Simple qw( mirror is_success status_message $ua )'; 15 | +plan skip_all => 'LWP::Simple required for this test' if $@; 16 | + 17 | 18 | plan skip_all => 'Set DIGEST_MD6_SLOW_TESTS to enable' 19 | unless $ENV{DIGEST_MD6_SLOW_TESTS}; 20 | -------------------------------------------------------------------------------- /patches/Feersum/0001-13-pre-fork.t.diff: -------------------------------------------------------------------------------- 1 | --- t/13-pre-fork.t.orig 2015-10-13 22:58:01.000000000 +0300 2 | +++ t/13-pre-fork.t 2015-10-13 22:58:32.000000000 +0300 3 | @@ -46,6 +46,9 @@ 4 | POSIX::exit(0); 5 | } 6 | 7 | +# wait a bit for Feersum daemon process 8 | +sleep 2; 9 | + 10 | $cv = AE::cv; 11 | simple_get($port, $_) for (1..CLIENTS); 12 | $cv->recv; 13 | -------------------------------------------------------------------------------- /patches/Filter-Util-Call/0001-Makefile.PL.diff: -------------------------------------------------------------------------------- 1 | --- Makefile.PL.orig 2014-08-15 11:44:08.203689160 +0400 2 | +++ Makefile.PL 2014-08-15 11:44:39.791689142 +0400 3 | @@ -62,6 +62,19 @@ 4 | 5 | INSTALLDIRS => ($] >= 5.00703 ? 'perl' : 'site'), 6 | 7 | + XS => { 8 | + 'Call.xs' => 'Call/Call.c', 9 | + 'Exec.xs' => 'Exec/Exec.c', 10 | + 'decrypt.xs' => 'decrypt/decrypt.c', 11 | + 'tee.xs' => 'tee/tee.c', 12 | + }, 13 | + OBJECT => [ 14 | + 'Call/Call.o', 15 | + 'Exec/Exec.o', 16 | + 'tee/tee.o', 17 | + 'decrypt/decrypt.o', 18 | + ], 19 | + 20 | ((ExtUtils::MakeMaker->VERSION() gt '6.30') ? 21 | ('LICENSE' => 'perl', SIGN => 1) : ()), 22 | ((ExtUtils::MakeMaker->VERSION() gt '6.46') ? 23 | -------------------------------------------------------------------------------- /patches/IO-AIO/0001-AIO.xs.diff: -------------------------------------------------------------------------------- 1 | --- AIO.xs.orig Mon Aug 17 16:26:29 2015 2 | +++ AIO.xs Mon Aug 17 16:27:02 2015 3 | @@ -159,9 +159,11 @@ 4 | # define minor(dev) ((dev) & 0xff) 5 | #endif 6 | 7 | +#ifndef __sun__ 8 | #if PAGESIZE <= 0 9 | # define PAGESIZE sysconf (_SC_PAGESIZE) 10 | #endif 11 | +#endif 12 | 13 | /*****************************************************************************/ 14 | 15 | -------------------------------------------------------------------------------- /patches/IO-Tty/0001-Makefile.PL.diff: -------------------------------------------------------------------------------- 1 | --- Makefile.PL.orig 2013-12-23 10:50:43.353559493 +0400 2 | +++ Makefile.PL 2013-12-23 10:51:09.983826393 +0400 3 | @@ -406,7 +406,8 @@ 4 | 'LIBS' => join(" ", @libs), 5 | 'clean' => {'FILES' => 'xssubs.c conf Tty.exp_old log'}, 6 | 'realclean' => {'FILES' => 'Tty IO-Tty.ppd'}, 7 | - 'MAP_TARGET' => 'perltty', 8 | +# staticperl expects MAP_TARGET = perl 9 | +# 'MAP_TARGET' => 'perltty', 10 | 'AUTHOR' => 'Roland Giersig ', 11 | 'ABSTRACT' => 'Pseudo ttys and constants', 12 | 'LICENSE' => 'perl', 13 | 14 | -------------------------------------------------------------------------------- /patches/LMDB_File/0001-Makefile.PL.diff: -------------------------------------------------------------------------------- 1 | --- Makefile.PL.orig 2015-07-24 05:03:40.000000000 -0400 2 | +++ Makefile.PL 2015-07-24 05:03:51.000000000 -0400 3 | @@ -3,10 +3,6 @@ 4 | use ExtUtils::MakeMaker; 5 | use Config; 6 | 7 | -if($Config{archname} =~ /686/) { 8 | - warn "liblmdb isn't supported in your platform, sorry.\n"; 9 | - exit 0; 10 | -} 11 | 12 | my $LNAME = 'LMDB'; 13 | my $NAME = "${LNAME}_File"; -------------------------------------------------------------------------------- /patches/Math-BigInt-GMP/0001-bigfltpm.inc.patch: -------------------------------------------------------------------------------- 1 | --- i/t/bigfltpm.inc 2 | +++ w/t/bigfltpm.inc 3 | @@ -1406,8 +1406,8 @@ NaNmul:-inf:NaN 4 | &fdiv-list 5 | 0:0:NaN,NaN 6 | 0:1:0,0 7 | -9:4:2.25,1 8 | -9:5:1.8,4 9 | +9:4:2,1 10 | +9:5:1,4 11 | # bug in v1.74 with bdiv in list context, when $y is 1 or -1 12 | 2.1:-1:-2.1,0 13 | 2.1:1:2.1,0 14 | -------------------------------------------------------------------------------- /patches/Unicode-LineBreak/0001-Makefile.PL.diff: -------------------------------------------------------------------------------- 1 | --- Makefile.PL.orig 2014-07-31 20:20:08.792674081 +0400 2 | +++ Makefile.PL 2014-07-31 20:20:12.969840007 +0400 3 | @@ -62,6 +62,9 @@ 4 | \$(MYEXTLIB): $csubdir\$(DIRFILESEP)Makefile 5 | \t$cd_make 6 | 7 | +$csubdir\$(DIRFILESEP)Makefile: 8 | +\t\$(PERL) Makefile.PL 9 | + 10 | copy_unidata : 11 | \tcd test-data; \\ 12 | \t[ -f LineBreakTest.txt ] || \\ 13 | -------------------------------------------------------------------------------- /patches/old/Net-SNMP-XS/Net-SNMP-XS_01.diff: -------------------------------------------------------------------------------- 1 | --- XS.xs.orig 2014-08-15 16:57:03.067678507 +0400 2 | +++ XS.xs 2014-08-15 16:57:45.555678482 +0400 3 | @@ -68,7 +68,7 @@ 4 | 5 | msg = newSVsv (neu); 6 | cur_bufobj = SvRV (msg); 7 | - sv_rvweaken (msg); 8 | + sv_rvweaken (neu); 9 | 10 | errflag = 0; 11 | leading_dot = -1; 12 | -------------------------------------------------------------------------------- /patches/staticperl/dollar_zero_crash_fix.diff: -------------------------------------------------------------------------------- 1 | --- staticperl.orig 2 | +++ staticperl 3 | @@ -1691,12 +1691,12 @@ 4 | PL_exit_flags |= PERL_EXIT_DESTRUCT_END; 5 | 6 | exitstatus = perl_parse (staticperl, staticperl_xs_init, argc + 3, args, environ); 7 | - free (args); 8 | if (!exitstatus) 9 | perl_run (staticperl); 10 | 11 | exitstatus = perl_destruct (staticperl); 12 | perl_free (staticperl); 13 | + free (args); 14 | PERL_SYS_TERM (); 15 | 16 | return exitstatus; 17 | --------------------------------------------------------------------------------