summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-02-24 16:05:55 -0700
committerKarl Williamson <public@khwilliamson.com>2013-08-29 09:55:55 -0600
commit61bbb4863a849ae88b9ea67d187db62a76837553 (patch)
tree6bb29bced2f8b4b0a793ee1b5b91209bafdba44b /t
parent1248eb9de867fb6d4c046f499398a770f6781c31 (diff)
downloadperl-61bbb4863a849ae88b9ea67d187db62a76837553.tar.gz
t/test.pl: Simplify ord to/from native fcns
This commit changes these functions from converting to/from a string to calling functions which operate on ordinals instead that are in the utf8:: namespace.
Diffstat (limited to 't')
-rw-r--r--t/test.pl8
1 files changed, 4 insertions, 4 deletions
diff --git a/t/test.pl b/t/test.pl
index 576df92e8c..e918a42ba4 100644
--- a/t/test.pl
+++ b/t/test.pl
@@ -1728,8 +1728,8 @@ sub ord_latin1_to_native {
# equivalent value. Anything above latin1 is itself.
my $ord = shift;
- return $ord if $ord > 255;
- return ord latin1_to_native(chr $ord);
+ return $ord if ord('^') == 94; # ASCII, Latin1
+ return utf8::unicode_to_native($ord);
}
sub ord_native_to_latin1 {
@@ -1737,8 +1737,8 @@ sub ord_native_to_latin1 {
# Anything above latin1 is itself.
my $ord = shift;
- return $ord if $ord > 255;
- return ord native_to_latin1(chr $ord);
+ return $ord if ord('^') == 94; # ASCII, Latin1
+ return utf8::native_to_unicode($ord);
}
1;