Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion split_clients.t
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand All @@ -42,13 +42,21 @@ http {
* ".three";
}

split_clients $uri $utf8_variant {
* "utf8";
}

server {
listen 127.0.0.1:8080;
server_name localhost;

location / {
index index${variant}.html;
}

location /a {
return 200 $utf8_variant;
}
}
}

Expand All @@ -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');

###############################################################################

Expand Down