File: 18currency.t

package info (click to toggle)
libunicode-linebreak-perl 0.0.20190101-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 1,064 kB
  • sloc: perl: 782; makefile: 7
file content (39 lines) | stat: -rw-r--r-- 1,008 bytes parent folder | download
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
use strict;
use Test::More;

use FindBin;
use lib "$FindBin::Bin/..";
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');
    } elsif ($c == 0x20BE) {
	is($gc->lbc, Unicode::LineBreak::LB_PO(),
	    'U+20BE LARI SIGN lbc:PO');
    } else {
	is($gc->lbc, Unicode::LineBreak::LB_PR(),
	    sprintf 'U+%04X lbc:PR', $c);
    }
}