Mercurial > hg > nginx-tests
diff stream_resolver.t @ 1995:d329b05e20fa
Tests: removed usage of "cat" and "grep" in tests.
Both "cat" and "grep" might not be available on Windows. Instead,
$t->read_file() is used, as it is already used in other places. To
simplify checking logs as previously done with "grep", $t->grep_file()
helper function is introduced.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Fri, 09 Aug 2024 05:18:51 +0300 |
parents | f3ba4c74de31 |
children |
line wrap: on
line diff
--- a/stream_resolver.t +++ b/stream_resolver.t @@ -107,7 +107,7 @@ ok(stream('127.0.0.1:' . port(8086))->re SKIP: { skip "relies on error log contents", 2 unless $ENV{TEST_NGINX_UNSAFE}; -my $log = `grep -F '[error]' ${\($t->testdir())}/error.log`; +my $log = $t->grep_file('error.log', '[error]'); like($log, qr/no port in upstream "a.example.com"/, 'log - no port'); like($log, qr/nx.example.com could not be resolved/, 'log - not found');