Skip to content

Commit ac955b2

Browse files
committed
Tests: added js tests for Fetch API objects.
In addition, due to the fact that Headers.prototype.keys() now returns sorted header names one js_fetch.t test became broken. To fix it without introducing version check the test was changed so headers received from upstream are already sorted.
1 parent 7d6ba14 commit ac955b2

File tree

2 files changed

+543
-4
lines changed

2 files changed

+543
-4
lines changed

js_fetch.t

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ like(http_get('/header?loc=duplicate_header&h=BAR'), qr/200 OK.*c$/s,
421421
'fetch header');
422422
like(http_get('/header?loc=duplicate_header&h=BARR'), qr/200 OK.*null$/s,
423423
'fetch no header');
424-
like(http_get('/header?loc=duplicate_header&h=foo'), qr/200 OK.*a,b$/s,
424+
like(http_get('/header?loc=duplicate_header&h=foo'), qr/200 OK.*a, ?b$/s,
425425
'fetch header duplicate');
426426
like(http_get('/header?loc=duplicate_header&h=BAR&method=getAll'),
427427
qr/200 OK.*\['c']$/s, 'fetch getAll header');
@@ -452,7 +452,7 @@ todo_skip 'leaves coredump', 1 unless $ENV{TEST_NGINX_UNSAFE}
452452
or has_version('0.7.4');
453453

454454
like(http_get('/header_iter?loc=duplicate_header_large'),
455-
qr/\['A:a','B:a','C:a','D:a','E:a','F:a','G:a','H:a','Foo:a,b']$/s,
455+
qr/\['A:a','B:a','C:a','D:a','E:a','F:a','G:a','H:a','Moo:a, ?b']$/s,
456456
'fetch header duplicate large');
457457

458458
}
@@ -579,8 +579,8 @@ sub http_daemon {
579579
"F: a" . CRLF .
580580
"G: a" . CRLF .
581581
"H: a" . CRLF .
582-
"Foo: a" . CRLF .
583-
"Foo: b" . CRLF .
582+
"Moo: a" . CRLF .
583+
"Moo: b" . CRLF .
584584
"Connection: close" . CRLF .
585585
CRLF;
586586

0 commit comments

Comments
 (0)