File: space.t

package info (click to toggle)
libmarc-charset-perl 0.95-1etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 2,444 kB
  • ctags: 75
  • sloc: xml: 98,939; perl: 612; makefile: 52
file content (21 lines) | stat: -rw-r--r-- 486 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
use Test::More tests => 3;
use strict;
use warnings;

use MARC::Charset 'marc8_to_utf8';
use MARC::Charset::Constants ':all';

is('foo bar', marc8_to_utf8('foo bar'), 'one space');
is('foo  bar', marc8_to_utf8('foo  bar'), 'two spaces');

my $test = 
    'a   ' . 
    ESCAPE . SINGLE_G0_A . BASIC_GREEK . 
    chr(0x49) .
    ESCAPE . SINGLE_G0_A . BASIC_LATIN . 
    '   b';

my $expected = 'a   ' . chr(0x0396) . '   b';
is(marc8_to_utf8($test), $expected, 'spacing with escape');