diff options
| author | fukachan <fukachan> | 2018-01-13 07:58:45 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2018-01-13 07:58:45 +0000 |
| commit | 3737ee86a2a5db87546ee8531a5a8b7f2d7a0808 (patch) | |
| tree | 5c419bcaee1c90c9f7f8fb98e1dc76aafc61dd97 | |
| parent | 6c1a95c043e07313f28025a84e46b1bb9718aa73 (diff) | |
| download | fml8-3737ee86a2a5db87546ee8531a5a8b7f2d7a0808.tar.gz fml8-3737ee86a2a5db87546ee8531a5a8b7f2d7a0808.tar.bz2 fml8-3737ee86a2a5db87546ee8531a5a8b7f2d7a0808.zip | |
Initial revision
| -rw-r--r-- | cpan/dist/Crypt-RandPasswd/META.json | 48 | ||||
| -rw-r--r-- | cpan/dist/Crypt-RandPasswd/META.yml | 24 | ||||
| -rw-r--r-- | cpan/dist/Crypt-RandPasswd/t/01-word.t | 23 | ||||
| -rw-r--r-- | cpan/dist/Crypt-RandPasswd/t/02-letters.t | 24 | ||||
| -rw-r--r-- | cpan/dist/Crypt-RandPasswd/t/03-chars.t | 37 |
5 files changed, 156 insertions, 0 deletions
diff --git a/cpan/dist/Crypt-RandPasswd/META.json b/cpan/dist/Crypt-RandPasswd/META.json new file mode 100644 index 00000000..bf59ea31 --- /dev/null +++ b/cpan/dist/Crypt-RandPasswd/META.json @@ -0,0 +1,48 @@ +{ + "abstract" : "unknown", + "author" : [ + "unknown" + ], + "dynamic_config" : 1, + "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.141170", + "license" : [ + "perl_5" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : "2" + }, + "name" : "Crypt-RandPasswd", + "no_index" : { + "directory" : [ + "t", + "inc" + ] + }, + "prereqs" : { + "build" : { + "requires" : { + "ExtUtils::MakeMaker" : "0" + } + }, + "configure" : { + "requires" : { + "ExtUtils::MakeMaker" : "0" + } + }, + "runtime" : { + "requires" : { + "perl" : "5.006" + } + } + }, + "release_status" : "stable", + "resources" : { + "repository" : { + "type" : "git", + "url" : "git://github.com/neilbowers/Crypt-RandPasswd.git", + "web" : "https://github.com/neilbowers/Crypt-RandPasswd" + } + }, + "version" : "0.06" +} diff --git a/cpan/dist/Crypt-RandPasswd/META.yml b/cpan/dist/Crypt-RandPasswd/META.yml new file mode 100644 index 00000000..54468f39 --- /dev/null +++ b/cpan/dist/Crypt-RandPasswd/META.yml @@ -0,0 +1,24 @@ +--- +abstract: unknown +author: + - unknown +build_requires: + ExtUtils::MakeMaker: '0' +configure_requires: + ExtUtils::MakeMaker: '0' +dynamic_config: 1 +generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.141170' +license: perl +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: '1.4' +name: Crypt-RandPasswd +no_index: + directory: + - t + - inc +requires: + perl: '5.006' +resources: + repository: git://github.com/neilbowers/Crypt-RandPasswd.git +version: '0.06' diff --git a/cpan/dist/Crypt-RandPasswd/t/01-word.t b/cpan/dist/Crypt-RandPasswd/t/01-word.t new file mode 100644 index 00000000..2dc862c0 --- /dev/null +++ b/cpan/dist/Crypt-RandPasswd/t/01-word.t @@ -0,0 +1,23 @@ +#!perl + +use strict; +use warnings; +use Crypt::RandPasswd qw(word); +use Test::More 0.88 tests => 20; + +my $word; +my $length; +my $min_length; +my $max_length; + +for ($length = 10; $length < 20; $length++) { + $word = Crypt::RandPasswd->word($length, $length); + ok(length($word) == $length, "create random word of length $length"); +} + +for ($min_length = 5; $min_length < 15; $min_length++) { + $max_length = $min_length + 5; + $word = Crypt::RandPasswd->word($min_length, $max_length); + ok(length($word) >= $min_length && length($word) <= $max_length, + "create random word of length $min_length .. $max_length"); +} diff --git a/cpan/dist/Crypt-RandPasswd/t/02-letters.t b/cpan/dist/Crypt-RandPasswd/t/02-letters.t new file mode 100644 index 00000000..8eca5377 --- /dev/null +++ b/cpan/dist/Crypt-RandPasswd/t/02-letters.t @@ -0,0 +1,24 @@ +#!perl + +use strict; +use warnings; +use Crypt::RandPasswd; +use Test::More 0.88 tests => 20; + +my $word; +my $length; +my $min_length; +my $max_length; + +for ($length = 10; $length < 20; $length++) { + $word = Crypt::RandPasswd->letters($length, $length); + ok(length($word) == $length && $word =~ /^[a-z]+$/, + "create random letter string of length $length"); +} + +for ($min_length = 5; $min_length < 15; $min_length++) { + $max_length = $min_length + 5; + $word = Crypt::RandPasswd->letters($min_length, $max_length); + ok(length($word) >= $min_length && length($word) <= $max_length && $word =~ /^[a-z]+$/, + "create random letter string of length $min_length .. $max_length"); +} diff --git a/cpan/dist/Crypt-RandPasswd/t/03-chars.t b/cpan/dist/Crypt-RandPasswd/t/03-chars.t new file mode 100644 index 00000000..183161a5 --- /dev/null +++ b/cpan/dist/Crypt-RandPasswd/t/03-chars.t @@ -0,0 +1,37 @@ +#!perl + +use strict; +use warnings; +use Crypt::RandPasswd; +use Test::More 0.88 tests => 20; + +my $word; +my $length; +my $min_length; +my $max_length; +my @chars; +my $char; +my $regexp; + +for ($length = 10; $length < 20; $length++) { + $word = Crypt::RandPasswd->chars($length, $length); + ok(length($word) == $length && valid_chars($word), + "create random letter string of length $length"); +} + +for ($min_length = 5; $min_length < 15; $min_length++) { + $max_length = $min_length + 5; + $word = Crypt::RandPasswd->chars($min_length, $max_length); + ok(length($word) >= $min_length && length($word) <= $max_length && valid_chars($word), + "create random letter string of length $min_length .. $max_length"); +} + +sub valid_chars +{ + my $word = shift; + + foreach my $char (split('', $word)) { + return 0 if ord($char) < ord('!') || ord($char) > ord('~'); + } + return 1; +} |
