File: 200_leaks.t

package info (click to toggle)
libunicode-utf8-perl 0.62-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 492 kB
  • sloc: perl: 2,365; sh: 6; makefile: 3
file content (30 lines) | stat: -rw-r--r-- 623 bytes parent folder | download | duplicates (4)
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
#!perl
use strict;
use warnings;

use Test::More;

BEGIN {
    eval 'use Test::LeakTrace 0.10;';
    plan skip_all => 'Test::LeakTrace 0.10 is required for this test' if $@;
    plan tests => 3;
}

BEGIN {
    use_ok('Unicode::UTF8', qw[ decode_utf8
                                encode_utf8 ]);
}

no_leaks_ok {
    my $octets = 'Flygande bäckasiner söka hwila på mjuka tuvor';
    my $string = decode_utf8($octets);
} 'decode_utf8()';

no_leaks_ok {
    my $string = do {
        use utf8;
        'Flygande bäckasiner söka hwila på mjuka tuvor';
    };
    my $octets = encode_utf8($string);
} 'encode_utf8()';