Debian Codegraph @

t2/utf8.t

raw
1 use utf8;
2 use Test2::V0;
3 use Test2::Plugin::UTF8;
4 use Test2::API qw/test2_stack/;
5 use Test2::Harness::Util::JSON qw/decode_json/;
6 use Test2::Util qw/get_tid ipc_separator/;
7 # HARNESS-DURATION-SHORT
8
9 test2_stack()->top;
10 my ($hub) = test2_stack()->all();
11 my $fmt = $hub->format;
12 skip_all "This test requires the stream formatter"
13 unless $fmt && $fmt->isa('Test2::Formatter::Stream');
14
15 ok(1, "І ще трохи");
16
17 my $file = File::Spec->catfile($fmt->dir, join(ipc_separator() => 'events', $$, 0) . ".jsonl");
18 open(my $fh, '<:utf8', $file) or die "Could not open events file: $!";
19
20 my @lines = <$fh>;
21
22 like($lines[-1], qr/\QІ ще трохи\E/, "Wrote utf8, not double encoded");
23
24 done_testing;