File: 18currency.t

package info (click to toggle)
libunicode-linebreak-perl 0.0.20140601-2%2Bdeb8u2
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 4,124 kB
  • ctags: 1,278
  • sloc: ansic: 32,274; perl: 783; makefile: 2
file content (33 lines) | stat: -rw-r--r-- 861 bytes parent folder | download | duplicates (2)
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
use strict;
use Test::More;
require 't/lb.pl';

BEGIN { plan tests => 96 }

my @opts = (Context => 'EASTASIAN');

foreach my $c (0x20A0..0x20CF) {
    my $gc = Unicode::GCString->new(sprintf('%c', $c), @opts);
    if ($c == 0x20A9) {
	is($gc->columns, 1, 'U+20A9 WON SIGN eaw:H');
    } elsif ($c == 0x20AC) {
	is($gc->columns, 2, 'U+20AC EURO SIGN eaw:A');
    } else {
	is($gc->columns, 1,
	    sprintf 'U+%04X eaw:N', $c);
    }
    if ($c == 0x20A7) {
	is($gc->lbc, Unicode::LineBreak::LB_PO(),
	    'U+20A7 PESETA SIGN lbc:PO');
    } elsif ($c == 0x20B6) {
	is($gc->lbc, Unicode::LineBreak::LB_PO(),
	    'U+20B6 LIVRE TOURNOIS SIGN lbc:PO');
    } elsif ($c == 0x20BB) {
	is($gc->lbc, Unicode::LineBreak::LB_PO(),
	    'U+20BB NORDIC MARK SIGN lbc:PO');
    } else {
	is($gc->lbc, Unicode::LineBreak::LB_PR(),
	    sprintf 'U+%04X lbc:PR', $c);
    }
}