File: 44-no-unicode-bug.t

package info (click to toggle)
libredis-fast-perl 0.29%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 464 kB
  • sloc: perl: 2,540; makefile: 7
file content (23 lines) | stat: -rwxr-xr-x 609 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!perl

use warnings;
use strict;
use Test::More;
use Test::Fatal;
use Redis::Fast;
use lib 't/tlib';
use Test::SpawnRedisServer;

my ($c, $srv) = redis();
END { $c->() if $c }

ok(my $r = Redis::Fast->new(server => $srv), 'connected to our test redis-server');
my $s2 = my $s1 = "test\x{80}";
utf8::upgrade($s1); # no need to use 'use utf8' to call this
utf8::downgrade($s2); # no need to use 'use utf8' to call this
ok ($s1 eq $s2, 'assume test string are considered identical by perl');
$r->set($s1 => 42);
is $r->get($s2), 42, "same binary strings should point to same keys";

## All done
done_testing();