File: test-big5.patch

package info (click to toggle)
libunicode-map-perl 0.112-11
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 1,176 kB
  • ctags: 183
  • sloc: perl: 1,170; makefile: 20; sh: 10
file content (45 lines) | stat: -rw-r--r-- 1,136 bytes parent folder | download | duplicates (3)
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
39
40
41
42
43
44
45
Author: Niko Tyni <ntyni@iki.fi>
Description: Test the fixed BIG5 map in t/map.t.
Bug: #320406

--- a/t/map.t
+++ b/t/map.t
@@ -6,7 +6,7 @@
 # Change 1..1 below to 1..last_test_to_print .
 # (It may become useful if the test is moved to ./t subdirectory.)
 
-BEGIN { $| = 1; print "1..5\n"; }
+BEGIN { $| = 1; print "1..6\n"; }
 END {print "not ok 1\n" unless $loaded;}
 use Unicode::Map;
 $loaded = 1;
@@ -27,6 +27,7 @@ my @test = ( 
    ["GB2312",         "n->m: GB2312 (GB2312-80^8080 + ISO8859-1)"],
    ["DEVANAGA",       "n->m: DEVANAGA"],
    ["EUC_JP",         "n->m: EUC-JP"],
+   ["BIG5",           "n->m: BIG5"],
 );
 
 {
@@ -133,6 +134,21 @@ sub DEVANAGA {
    return testMapping ( "APPLE-DEVANAGA", $_locale, $_unicode );
 }
 
+sub BIG5 {
+   my $_locale  =
+      "\xA5\x40"
+      ."\xA5\x41"
+      ."\x30"
+      ."  "
+   ;
+   my $_unicode =
+      "\x4E\x16"
+      ."\x4E\x15"
+      ."\x00\x30\x00\x20\x00\x20"
+   ;
+   return testMapping ( "BIG5", $_locale, $_unicode );
+}
+
 sub testMapping {
     my ( $charsetId, $txtLocale, $txtUnicode ) = @_;
     return 0 if ! ( my $Map = new Unicode::Map($charsetId) );