Scalar-String-0.002000755001750001750 011550067366 14130 5ustar00zeframzefram000000000000Scalar-String-0.002/META.yml000444001750001750 140711550067355 15536 0ustar00zeframzefram000000000000--- abstract: 'string aspects of scalars' author: - 'Andrew Main (Zefram) ' build_requires: Module::Build: 0 Test::More: 0 perl: 5.006 strict: 0 warnings: 0 configure_requires: Module::Build: 0 perl: 5.006 strict: 0 warnings: 0 dynamic_config: 1 generated_by: 'Module::Build version 0.38, CPAN::Meta::Converter version 2.110580' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Scalar-String provides: Scalar::String: file: lib/Scalar/String.pm version: 0.002 recommends: XSLoader: 0 requires: Carp: 0 Exporter: 0 bytes: 0 if: 0 parent: 0 perl: 5.006 strict: 0 utf8: 0 warnings: 0 resources: license: http://dev.perl.org/licenses/ version: 0.002 Scalar-String-0.002/SIGNATURE000644001750001750 330111550067366 15550 0ustar00zeframzefram000000000000This file contains message digests of all files listed in MANIFEST, signed via the Module::Signature module, version 0.66. To verify the content in this distribution, first make sure you have Module::Signature installed, then type: % cpansign -v It will check each file's integrity, as well as the signature's validity. If "==> Signature verified OK! <==" is not displayed, the distribution may already have been compromised, and you should not run its Makefile.PL or Build.PL. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 SHA1 9fa7981bd10297dfe4ed37b6ad96f35326d29396 .cvsignore SHA1 69644b6e77995e79f0ca7a6813a6ea8115adba30 Build.PL SHA1 d2ab585015cddf3feefc86b756fbe4239e29a23a Changes SHA1 8670cb69238325e4d24ffaac6a192f78f77b9d40 MANIFEST SHA1 88f1530a143361b5b905b38c39eb6381ae0ae804 META.json SHA1 fb2ff31fabee91930b3b15fdb1497840de8a9e02 META.yml SHA1 2157ae40589595d6cc1585fd7279b25bcf8f5852 Makefile.PL SHA1 ca61089d299bdd5e8b46bab6b3df6a9120735125 README SHA1 c185a100351b2eb6d840b8ff2ce73c96d154f6a6 lib/Scalar/.cvsignore SHA1 67669ff83780aed544041758b04829d1d0a7a79c lib/Scalar/String.pm SHA1 a1401fed7bd4ae529987183449638576e52a170c lib/Scalar/String.xs SHA1 f36c5928277d92e38d3eb240221dfcfcc6d51cce t/grade.t SHA1 438cb548ab97eede0c7f70604f2a33ac4990af10 t/grade_pp.t SHA1 904d9a4f76525e2303e4b0c168c68230f223c8de t/pod_cvg.t SHA1 3f447b1d0b8a6247c3a311087f8d66da1c3ca5db t/pod_cvg_pp.t SHA1 65c75abdef6f01a5d1588a307f2ddfe2333dc961 t/pod_syn.t SHA1 329a2984b7ee54b4f6f12ca70ffaa9513945fea3 t/setup_pp.pl -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAk2gbu0ACgkQOV9mt2VyAVF8VACfeggJjQvSWgwB4Vi+eRorQnU3 OzsAoInVGJqOMIiSDZkyzWM9kXmljj77 =6T4Z -----END PGP SIGNATURE----- Scalar-String-0.002/MANIFEST000444001750001750 40011550067355 15366 0ustar00zeframzefram000000000000.cvsignore Build.PL Changes MANIFEST META.json META.yml Makefile.PL README lib/Scalar/.cvsignore lib/Scalar/String.pm lib/Scalar/String.xs t/grade.t t/grade_pp.t t/pod_cvg.t t/pod_cvg_pp.t t/pod_syn.t t/setup_pp.pl SIGNATURE Added here by Module::Build Scalar-String-0.002/Changes000444001750001750 224011550067355 15554 0ustar00zeframzefram000000000000version 0.002; 2011-04-09 * in XS, declare "PROTOTYPES: DISABLE" to prevent automatic generation of unintended prototypes * in t/setup_pp.pl, avoid a warning that occurs if XSLoader::load() is given no arguments, which is now a valid usage * typo fix in documentation * include META.json in distribution * add MYMETA.json to .cvsignore version 0.001; 2010-07-29 * in documentation, correct the word "numericness" to "stringness" * make all numeric comparisons against $] stringify it first, to avoid architecture-dependent problems with floating point rounding giving it an unexpected numeric value * in XS, use PERL_NO_GET_CONTEXT for efficiency * use simpler "parent" pragma in place of "base" * check for required Perl version at runtime * use full stricture in test suite * also test POD coverage of pure Perl implementation * in Build.PL, explicitly set needs_compiler to avoid bogus auto-dependency on ExtUtils::CBuilder * in Build.PL, explicitly declare configure-time requirements * remove bogus "exit 0" from Build.PL * add MYMETA.yml to .cvsignore version 0.000; 2009-03-14 * initial released version Scalar-String-0.002/README000444001750001750 171611550067355 15150 0ustar00zeframzefram000000000000NAME Scalar::String - string aspects of scalars DESCRIPTION This module is about the string part of plain Perl scalars. A scalar has a string value, which is notionally a sequence of Unicode codepoints, but may be internally encoded in either ISO-8859-1 or UTF-8. In places, and more so in older versions of Perl, the internal encoding shows through. To fully understand Perl strings it is necessary to understand these implementation details. This module provides functions to classify a string by encoding and to encode a string in a desired way. This module is implemented in XS, with a pure Perl backup version for systems that can't handle XS. INSTALLATION perl Build.PL ./Build ./Build test ./Build install AUTHOR Andrew Main (Zefram) COPYRIGHT Copyright (C) 2009, 2010, 2011 Andrew Main (Zefram) LICENSE This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Scalar-String-0.002/Makefile.PL000444001750001750 233311550067355 16236 0ustar00zeframzefram000000000000# Note: this file was auto-generated by Module::Build::Compat version 0.3800 require 5.006; unless (eval "use Module::Build::Compat 0.02; 1" ) { print "This module requires Module::Build to install itself.\n"; require ExtUtils::MakeMaker; my $yn = ExtUtils::MakeMaker::prompt (' Install Module::Build now from CPAN?', 'y'); unless ($yn =~ /^y/i) { die " *** Cannot install without Module::Build. Exiting ...\n"; } require Cwd; require File::Spec; require CPAN; # Save this 'cause CPAN will chdir all over the place. my $cwd = Cwd::cwd(); CPAN::Shell->install('Module::Build::Compat'); CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate or die "Couldn't install Module::Build, giving up.\n"; chdir $cwd or die "Cannot chdir() back to $cwd: $!"; } eval "use Module::Build::Compat 0.02; 1" or die $@; use lib '_build/lib'; Module::Build::Compat->run_build_pl(args => \@ARGV); my $build_script = 'Build'; $build_script .= '.com' if $^O eq 'VMS'; exit(0) unless(-e $build_script); # cpantesters convention require MyModuleBuilder; Module::Build::Compat->write_makefile(build_class => 'MyModuleBuilder'); Scalar-String-0.002/.cvsignore000444001750001750 15311550067355 16242 0ustar00zeframzefram000000000000Build Makefile _build blib META.json META.yml MYMETA.json MYMETA.yml Makefile.PL SIGNATURE Scalar-String-* Scalar-String-0.002/META.json000444001750001750 267011550067355 15711 0ustar00zeframzefram000000000000{ "abstract" : "string aspects of scalars", "author" : [ "Andrew Main (Zefram) " ], "dynamic_config" : 1, "generated_by" : "Module::Build version 0.38, CPAN::Meta::Converter version 2.110580", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Scalar-String", "prereqs" : { "build" : { "requires" : { "Module::Build" : 0, "Test::More" : 0, "perl" : "5.006", "strict" : 0, "warnings" : 0 } }, "configure" : { "requires" : { "Module::Build" : 0, "perl" : "5.006", "strict" : 0, "warnings" : 0 } }, "runtime" : { "recommends" : { "XSLoader" : 0 }, "requires" : { "Carp" : 0, "Exporter" : 0, "bytes" : 0, "if" : 0, "parent" : 0, "perl" : "5.006", "strict" : 0, "utf8" : 0, "warnings" : 0 } } }, "provides" : { "Scalar::String" : { "file" : "lib/Scalar/String.pm", "version" : "0.002" } }, "release_status" : "stable", "resources" : { "license" : [ "http://dev.perl.org/licenses/" ] }, "version" : "0.002" } Scalar-String-0.002/Build.PL000444001750001750 347511550067355 15570 0ustar00zeframzefram000000000000{ use 5.006; } use warnings; use strict; use Module::Build; Module::Build->subclass(code => q{ unless(__PACKAGE__->can("cbuilder")) { *cbuilder = sub { $_[0]->_cbuilder or die "no C support" }; } unless(__PACKAGE__->can("have_c_compiler")) { *have_c_compiler = sub { my $cb = eval { $_[0]->cbuilder }; return $cb && $cb->have_compiler; }; } if($Module::Build::VERSION < 0.33) { # Older versions of Module::Build have a bug where if the # cbuilder object is used at Build.PL time (which it will # be for this distribution due to the logic in # ->find_xs_files) then that object can be dumped to the # build_params file, and then at Build time it will # attempt to use the dumped blessed object without loading # the ExtUtils::CBuilder class that is needed to make it # work. *write_config = sub { delete $_[0]->{properties}->{_cbuilder}; return $_[0]->SUPER::write_config; }; } sub find_xs_files { my($self) = @_; return {} unless $self->have_c_compiler; return $self->SUPER::find_xs_files; } })->new( module_name => "Scalar::String", license => "perl", configure_requires => { "Module::Build" => 0, "perl" => "5.006", "strict" => 0, "warnings" => 0, }, configure_recommends => { "ExtUtils::CBuilder" => "0.15", }, build_requires => { "Module::Build" => 0, "Test::More" => 0, "perl" => "5.006", "strict" => 0, "warnings" => 0, }, build_recommends => { "ExtUtils::CBuilder" => "0.15", }, requires => { "Carp" => 0, "Exporter" => 0, "bytes" => 0, "if" => 0, "parent" => 0, "perl" => "5.006", "strict" => 0, "utf8" => 0, "warnings" => 0, }, recommends => { "XSLoader" => 0, }, needs_compiler => 0, dynamic_config => 1, meta_add => { distribution_type => "module" }, create_makefile_pl => "passthrough", sign => 1, )->create_build_script; 1; Scalar-String-0.002/lib000755001750001750 011550067355 14674 5ustar00zeframzefram000000000000Scalar-String-0.002/lib/Scalar000755001750001750 011550067355 16101 5ustar00zeframzefram000000000000Scalar-String-0.002/lib/Scalar/.cvsignore000444001750001750 1111550067355 20166 0ustar00zeframzefram000000000000String.c Scalar-String-0.002/lib/Scalar/String.pm000444001750001750 2214311550067355 20064 0ustar00zeframzefram000000000000=head1 NAME Scalar::String - string aspects of scalars =head1 SYNOPSIS use Scalar::String qw(sclstr_is_upgraded sclstr_is_downgraded); if(sclstr_is_upgraded($value)) { ... if(sclstr_is_downgraded($value)) { ... use Scalar::String qw( sclstr_upgrade_inplace sclstr_upgraded sclstr_downgrade_inplace sclstr_downgraded ); sclstr_upgrade_inplace($value); $value = sclstr_upgraded($value); sclstr_downgrade_inplace($value); $value = sclstr_downgraded($value); =head1 DESCRIPTION This module is about the string part of plain Perl scalars. A scalar has a string value, which is notionally a sequence of Unicode codepoints, but may be internally encoded in either ISO-8859-1 or UTF-8. In places, and more so in older versions of Perl, the internal encoding shows through. To fully understand Perl strings it is necessary to understand these implementation details. This module provides functions to classify a string by encoding and to encode a string in a desired way. This module is implemented in XS, with a pure Perl backup version for systems that can't handle XS. =head1 STRING ENCODING ISO-8859-1 is a simple 8-bit character encoding, which represents the first 256 Unicode characters (codepoints 0x00 to 0xff) in one octet each. This is how strings were historically represented in Perl. A string represented this way is referred to as "downgraded". UTF-8 is a variable-width character encoding, which represents all possible Unicode codepoints in differing numbers of octets. A design feature of UTF-8 is that ASCII characters (codepoints 0x00 to 0x7f) are each represented in a single octet, identically to their ISO-8859-1 encoding. Perl has its own variant of UTF-8, which can handle a wider range of codepoints than Unicode formally allows. A string represented in this variant UTF-8 is referred to as "upgraded". A Perl string is physically represented as a string of octets along with a flag that says whether the string is downgraded or upgraded. At this level, to determine the Unicode codepoints that are represented requires examining both parts of the representation. If the string contains only ASCII characters then the octet sequence is identical in either encoding, but Perl still maintains an encoding flag on such a string. A string is always either downgraded or upgraded; it is never both or neither. When handling string input, it is good form to operate only on the Unicode characters represented by the string, ignoring the manner in which they are encoded. Basic string operations such as concatenation work this way (except for a bug in perl 5.6.0), so simple code written in pure Perl is generally safe on this front. Pieces of character-based code can pass around strings among themselves, and always get consistent behaviour, without worrying about the way in which the characters are encoded. However, due to an historical accident, a lot of C code that interfaces with Perl looks at the octets used to represent a string without also examining the encoding flag. Such code gives inconsistent behaviour for the same character sequence represented in the different ways. In perl 5.6, many pure Perl operations (such as regular expression matching) also work this way, though some of them can be induced to work correctly by using the L pragma. In perl 5.8, regular expression matching is character-based by default, but many I/O functions (such as C) are still octet-based. Where code that operates on the octets of a string must be used by code that operates on characters, the latter needs to pay attention to the encoding of its strings. Commonly, the octet-based code expects its input to be represented in a particular encoding, in which case the character-based code must oblige by forcing strings to that encoding before they are passed in. There are other usage patterns too. You will be least confused if you think about a Perl string as a character sequence plus an encoding flag. You should normally operate on the character sequence and not care about the encoding flag. Occasionally you must pay attention to the flag in addition to the characters. Unless you are writing C code, you should try not to think about a string the other way round, as an octet sequence plus encoding flag. =cut package Scalar::String; { use 5.006; } use warnings; use strict; our $VERSION = "0.002"; use parent "Exporter"; our @EXPORT_OK = qw( sclstr_is_upgraded sclstr_is_downgraded sclstr_upgrade_inplace sclstr_upgraded sclstr_downgrade_inplace sclstr_downgraded ); eval { local $SIG{__DIE__}; require XSLoader; XSLoader::load(__PACKAGE__, $VERSION); }; if($@ eq "") { close(DATA); } else { (my $filename = __FILE__) =~ tr# -~##cd; local $/ = undef; my $pp_code = "#line 128 \"$filename\"\n".; close(DATA); { local $SIG{__DIE__}; eval $pp_code; } die $@ if $@ ne ""; } 1; __DATA__ use Carp qw(croak); BEGIN { require utf8 if "$]" >= 5.008; } =head1 FUNCTIONS Each "sclstr_" function takes one or more scalar string arguments to operate on. These arguments must be strings; giving non-string arguments will cause mayhem. See L for a way to check for stringness. Only the string value of the scalar is used; the numeric value is completely ignored, so dualvars are not a problem. =head2 Classification =over =item sclstr_is_upgraded(VALUE) Returns a truth value indicating whether the provided string I is in upgraded form. =cut sub sclstr_is_upgraded($); if(defined &utf8::is_utf8) { *sclstr_is_upgraded = sub($) { &utf8::is_utf8 }; } else { *sclstr_is_upgraded = sub($) { # In perl 5.6, an upgraded string can be detected # (even if it contains no non-ASCII characters) by the # fact that concatenation with it will upgrade another # string. If the probe string contains a non-ASCII # character, its upgrading can be consistently detected # by examining the resulting byte sequence. return unpack("C", "\xaa".$_[0]) != 170; }; } =item sclstr_is_downgraded(VALUE) Returns a truth value indicating whether the provided string I is in downgraded form. =cut sub sclstr_is_downgraded($) { !&sclstr_is_upgraded } =back =head2 Regrading =over =item sclstr_upgrade_inplace(VALUE) Modifies the string I in-place, so that it is in upgraded form, regardless of how it was encoded before. The character sequence that it represents is unchanged. A cleaner interface to this operation is the non-mutating L. =cut sub sclstr_upgrade_inplace($); if("$]" >= 5.008) { *sclstr_upgrade_inplace = sub($) { &utf8::upgrade }; } else { # In perl 5.6, upgrade of a string can be forced by # concatenation with an upgraded string. chop(my $upgraded_empty_string = "\x{100}"); *sclstr_upgrade_inplace = sub($) { $_[0] .= $upgraded_empty_string; }; } =item sclstr_upgraded(VALUE) Returns a string that represents the same character sequence as the string I, and is in upgraded form (regardless of how I is encoded). =cut sub sclstr_upgraded($) { my($str) = @_; sclstr_upgrade_inplace($str); return $str; } =item sclstr_downgrade_inplace(VALUE[, FAIL_OK]) Modifies the string I in-place, so that it is in downgraded form, regardless of how it was encoded before. The character sequence that it represents is unchanged. If the string cannot be downgraded, because it contains a non-ISO-8859-1 character, then by default the function Cs, but if I is present and true then it will return leaving I unmodified. A cleaner interface to this operation is the non-mutating L. =cut sub sclstr_downgrade_inplace($;$); if("$]" >= 5.008) { *sclstr_downgrade_inplace = sub($;$) { utf8::downgrade($_[0], $_[1] || 0); }; } else { # In perl 5.6, there are very few operations that will # downgrade a string. One of the few is regexp submatch # capturing, with the match operator in array context. # Note: retrieving the submatch with $1 will *not* # downgrade. *sclstr_downgrade_inplace = sub($;$) { return unless sclstr_is_upgraded($_[0]); my ($down) = do { use if "$]" < 5.008, "bytes"; $_[0] =~ /\A[\x00-\x7f\x80-\xbf\xc2\xc3]*\z/; } ? do { use if "$]" < 5.008, "utf8"; ($_[0] =~ /\A([\x00-\xff]*)\z/); } : (undef); if(defined $down) { $_[0] = $down; } else { croak "Wide character prevents downgrading" unless $_[1]; } }; } =item sclstr_downgraded(VALUE[, FAIL_OK]) Returns a string that represents the same character sequence as the string I, and is in downgraded form (regardless of how I is encoded). If the string cannot be represented in downgraded form, because it contains a non-ISO-8859-1 character, then by default the function Cs, but if I is present and true then it will return I in its original upgraded form. =cut sub sclstr_downgraded($;$) { my($str, $fail_ok) = @_; sclstr_downgrade_inplace($str, $fail_ok); return $str; } =back =head1 SEE ALSO L =head1 AUTHOR Andrew Main (Zefram) =head1 COPYRIGHT Copyright (C) 2009, 2010, 2011 Andrew Main (Zefram) =head1 LICENSE This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut 1; Scalar-String-0.002/lib/Scalar/String.xs000444001750001750 201311550067355 20054 0ustar00zeframzefram000000000000#define PERL_NO_GET_CONTEXT 1 #include "EXTERN.h" #include "perl.h" #include "XSUB.h" MODULE = Scalar::String PACKAGE = Scalar::String PROTOTYPES: DISABLE bool sclstr_is_upgraded(SV *value) PROTOTYPE: $ CODE: RETVAL = !!SvUTF8(value); OUTPUT: RETVAL bool sclstr_is_downgraded(SV *value) PROTOTYPE: $ CODE: RETVAL = !SvUTF8(value); OUTPUT: RETVAL void sclstr_upgrade_inplace(SV *value) PROTOTYPE: $ CODE: sv_utf8_upgrade(value); SvUTF8_on(value); SV * sclstr_upgraded(SV *value) PROTOTYPE: $ CODE: if(SvUTF8(value)) { RETVAL = SvREFCNT_inc(value); } else { RETVAL = newSVsv(value); sv_utf8_upgrade(RETVAL); SvUTF8_on(RETVAL); } OUTPUT: RETVAL void sclstr_downgrade_inplace(SV *value, bool fail_ok = 0) PROTOTYPE: $;$ CODE: sv_utf8_downgrade(value, fail_ok); SV * sclstr_downgraded(SV *value, bool fail_ok = 0) PROTOTYPE: $;$ CODE: if(!SvUTF8(value)) { RETVAL = SvREFCNT_inc(value); } else { RETVAL = sv_mortalcopy(value); sv_utf8_downgrade(RETVAL, fail_ok); SvREFCNT_inc(RETVAL); } OUTPUT: RETVAL Scalar-String-0.002/t000755001750001750 011550067355 14371 5ustar00zeframzefram000000000000Scalar-String-0.002/t/pod_cvg_pp.t000444001750001750 14511550067355 17013 0ustar00zeframzefram000000000000use warnings; use strict; do "t/setup_pp.pl" or die $@ || $!; do "t/pod_cvg.t" or die $@ || $!; 1; Scalar-String-0.002/t/setup_pp.pl000444001750001750 32511550067355 16702 0ustar00zeframzefram000000000000require XSLoader; my $orig_load = \&XSLoader::load; no warnings "redefine"; *XSLoader::load = sub { die "XS loading disabled for Scalar::String" if ($_[0] || "") eq "Scalar::String"; goto &$orig_load; }; 1; Scalar-String-0.002/t/grade.t000444001750001750 441411550067355 16000 0ustar00zeframzefram000000000000use warnings; use strict; use Test::More tests => 1 + 31*4 + 31*4 + 14*20; use_ok "Scalar::String", qw( sclstr_is_upgraded sclstr_is_downgraded sclstr_upgrade_inplace sclstr_downgrade_inplace sclstr_upgraded sclstr_downgraded ); foreach my $tstr ( "", "abc", "a\x00b\x7fc", "a"x40000, ) { my @u = (sclstr_upgraded($tstr)); my @d = (sclstr_downgraded($tstr)); push @u, map { sclstr_upgraded($_) } $u[0], $d[0]; push @u, map { my $s = $_; sclstr_upgrade_inplace($s); $s } $u[0], $d[0]; push @d, map { my $s = $_; sclstr_downgrade_inplace($s); $s } $u[0], $d[0]; push @d, map { sclstr_downgraded($_) } $u[0], $d[0]; foreach(@u) { ok sclstr_is_upgraded($_); ok !sclstr_is_downgraded($_); ok $_ eq $u[0]; } foreach(@d) { ok !sclstr_is_upgraded($_); ok sclstr_is_downgraded($_); ok $_ eq $d[0]; } ok $u[0] eq $d[0]; } foreach my $tstr ( "\xc2\x80", "\x80abc\xff", "\xffabc\x80", ("a"x40000)."\x80", ) { my @u = (sclstr_upgraded($tstr)); my @d = (sclstr_downgraded($tstr)); push @u, map { sclstr_upgraded($_) } $u[0], $d[0]; push @d, map { sclstr_downgraded($_) } $u[0], $d[0]; push @u, map { my $s = $_; sclstr_upgrade_inplace($s); $s } $u[0], $d[0]; push @d, map { my $s = $_; sclstr_downgrade_inplace($s); $s } $u[0], $d[0]; foreach(@u) { ok sclstr_is_upgraded($_); ok !sclstr_is_downgraded($_); ok $_ eq $u[0]; } foreach(@d) { ok !sclstr_is_upgraded($_); ok sclstr_is_downgraded($_); ok $_ eq $d[0]; } ok ord($u[0]) == ord($d[0]); } no warnings "utf8"; foreach my $tstr ( "abc\x{100}xyz", "abc\x{d7ff}xyz", "abc\x{d800}xyz", "abc\x{dfff}xyz", "abc\x{e000}xyz", "abc\x{fdd0}xyz", "abc\x{fffd}xyz", "abc\x{fffe}xyz", "abc\x{ffff}xyz", "abc\x{10000}xyz", "abc\x{1fffd}xyz", "abc\x{1fffe}xyz", "abc\x{1ffff}xyz", "abc\x{20000}xyz", "abc\x{10fffd}xyz", "abc\x{10fffe}xyz", "abc\x{10ffff}xyz", "abc\x{110000}xyz", "abc\x{7fffffff}xyz", ("a"x40000)."\x{100}", ) { my @u = ($tstr); push @u, sclstr_upgraded($u[0]); eval { sclstr_downgraded($u[0]) }; isnt $@, ""; eval { sclstr_downgrade_inplace($u[0]) }; isnt $@, ""; push @u, sclstr_downgraded($u[0], 1); push @u, do { my $s = $u[0]; sclstr_downgrade_inplace($s, 1); $s }; foreach(@u) { ok sclstr_is_upgraded($_); ok !sclstr_is_downgraded($_); ok $_ eq $u[0]; } } 1; Scalar-String-0.002/t/pod_cvg.t000444001750001750 27311550067355 16316 0ustar00zeframzefram000000000000use warnings; use strict; use Test::More; plan skip_all => "Test::Pod::Coverage not available" unless eval "use Test::Pod::Coverage; 1"; Test::Pod::Coverage::all_pod_coverage_ok(); 1; Scalar-String-0.002/t/pod_syn.t000444001750001750 23611550067355 16347 0ustar00zeframzefram000000000000use warnings; use strict; use Test::More; plan skip_all => "Test::Pod not available" unless eval "use Test::Pod 1.00; 1"; Test::Pod::all_pod_files_ok(); 1; Scalar-String-0.002/t/grade_pp.t000444001750001750 14311550067355 16452 0ustar00zeframzefram000000000000use warnings; use strict; do "t/setup_pp.pl" or die $@ || $!; do "t/grade.t" or die $@ || $!; 1;