File: 01500_generate_no_warnings.t

package info (click to toggle)
libtext-unidecode-perl 1.30-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,236 kB
  • sloc: perl: 3,878; makefile: 2
file content (38 lines) | stat: -rw-r--r-- 1,330 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# -*- coding:utf-8; mode:CPerl -*-
use 5.8.0;
use Test; use strict; use warnings;
BEGIN { plan tests => 11 };
print q[# // Time-stamp: "2014-07-04 02:16:23 MDT sburke@cpan.org"], "\n";

# Summary of, well, things.
ok 1; print "# ^-- Hello\n";

use utf8;

ok binmode(*STDOUT, ":utf8"); print "# ^-- Testing binmode on STDOUT\n";
ok binmode(*STDERR, ":utf8"); print "# ^-- Testing binmode on STDERR\n";

use Text::Unidecode;
print "# Text::Unidecode version $Text::Unidecode::VERSION\n";

ok "a", unidecode("a"); print "# ^-- sanity\n";

{
  my($i, $n, $s);
  my $f = "# ^-- Testing: \"%s\" (U+%04x) returns true.  (\"%s\")\n";
  #print "# Format: $f\n";

  # Remember, when we call "ok" here, we're just testing for *truth*
  # The test would fail iif Unidecode returns an undef or "" (or "0")
  $n = unidecode( $s=chr($i= 0x0100 ) ); ok $n; printf $f => $s, $i, $n;
  $n = unidecode( $s=chr($i= 0x0400 ) ); ok $n; printf $f => $s, $i, $n;
  $n = unidecode( $s=chr($i= 0x0f00 ) ); ok $n; printf $f => $s, $i, $n;
  $n = unidecode( $s=chr($i= 0x01ff ) ); ok $n; printf $f => $s, $i, $n;
  $n = unidecode( $s=chr($i= 0x04ff ) ); ok $n; printf $f => $s, $i, $n;
  $n = unidecode( $s=chr($i= 0x0fff ) ); ok $n; printf $f => $s, $i, $n;

  #$n = unidecode( $s=chr($i=0x10000) ); ok $n; printf $f, $n, $s, $i;
}

print "# Bye:\n";
ok 1;