From 3fe65ad25d90eea6b7a2c7e12761ba30b7b04639 Mon Sep 17 00:00:00 2001 From: Oskar Eichler <62393985+OskarEichler@users.noreply.github.com> Date: Fri, 4 Sep 2026 23:10:08 +0700 Subject: [PATCH] Tests: add split clients UTF-8 key coverage --- split_clients.t | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) mode change 100644 => 100755 split_clients.t diff --git a/split_clients.t b/split_clients.t old mode 100644 new mode 100755 index 7666e1c0..25c79533 --- a/split_clients.t +++ b/split_clients.t @@ -22,7 +22,7 @@ use Test::Nginx; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http split_clients/)->plan(1); +my $t = Test::Nginx->new()->has(qw/http split_clients/)->plan(2); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -42,6 +42,10 @@ http { * ".three"; } + split_clients $uri $utf8_variant { + * "utf8"; + } + server { listen 127.0.0.1:8080; server_name localhost; @@ -49,6 +53,10 @@ http { location / { index index${variant}.html; } + + location /a { + return 200 $utf8_variant; + } } } @@ -65,6 +73,7 @@ $t->run(); # NB: split_clients distribution is a subject to implementation details like(many('/', 20), qr/first: 12, second: 2, third: 6/, 'split'); +like(http_get("/a\xC3\xA9"), qr/utf8/, 'utf8 key'); ###############################################################################