diff options
author | Christian Schneider | 2021-01-13 16:13:25 +0100 |
---|---|---|
committer | Christian Schneider | 2021-01-13 16:13:25 +0100 |
commit | 81e5fda87626dfe94d46be511ebc546076b1975b (patch) | |
tree | 9669ecb252500e514ff932df2e1036ab13cf8008 /test | |
parent | 1f57cc663c83ec44ec292256147f9811945e260a (diff) | |
download | itools-81e5fda87626dfe94d46be511ebc546076b1975b.tar.gz itools-81e5fda87626dfe94d46be511ebc546076b1975b.tar.bz2 itools-81e5fda87626dfe94d46be511ebc546076b1975b.zip |
Unified brace and else if style
Diffstat (limited to 'test')
-rwxr-xr-x | test/exec.t | 3 | ||||
-rwxr-xr-x | test/getopt.t | 3 | ||||
-rwxr-xr-x | test/it_html.t | 3 | ||||
-rw-r--r-- | test/it_url.testserver.php | 3 | ||||
-rw-r--r-- | test/it_url_server.php | 6 |
5 files changed, 11 insertions, 7 deletions
diff --git a/test/exec.t b/test/exec.t index 293ad61..5f78482 100755 --- a/test/exec.t +++ b/test/exec.t @@ -62,7 +62,8 @@ is( "... short option without dashes" ); -foreach (["", "C", "de_CH", "de_CH.utf8"] as $locale) { +foreach (["", "C", "de_CH", "de_CH.utf8"] as $locale) +{ setlocale(LC_ALL, $locale); $arg = "preüpost"; if (it::match('utf8', $locale)) diff --git a/test/getopt.t b/test/getopt.t index 48f7d9d..77e52ae 100755 --- a/test/getopt.t +++ b/test/getopt.t @@ -18,7 +18,8 @@ function getopt_ok($argv, $exp, $name) return is($got, $exp, $name); } -foreach (["" => "blah gnaber", " (umlaute)" => "pre üäpost"] as $variant => $testarg) { +foreach (["" => "blah gnaber", " (umlaute)" => "pre üäpost"] as $variant => $testarg) +{ $exp = ['args' => [], 'positional' => $testarg, 'argument' => $testarg, 'default' => 'defäult']; getopt_ok([$testarg, '-a', $testarg], $exp, "Short version" . $variant); getopt_ok([$testarg, '--argument', $testarg], $exp, "Long version with space" . $variant); diff --git a/test/it_html.t b/test/it_html.t index a43f674..aa734c0 100755 --- a/test/it_html.t +++ b/test/it_html.t @@ -253,9 +253,8 @@ is( 'empty tags removal' ); -foreach (json_decode(it::file_get_contents(dirname($argv[0]) . '/U_tests.json'), true) as $test) { +foreach (json_decode(it::file_get_contents(dirname($argv[0]) . '/U_tests.json'), true) as $test) is(U(...$test['args']), $test['exp'], $test['name']); -} is(it_html::entity_decode("ä"), "ä"); is(it_html::entity_decode("J"), "J"); diff --git a/test/it_url.testserver.php b/test/it_url.testserver.php index f02b316..2d1bca4 100644 --- a/test/it_url.testserver.php +++ b/test/it_url.testserver.php @@ -52,7 +52,8 @@ switch ($_SERVER['PHP_SELF']) break; case "/slow_response": - for ($i = 0; $i < 6; $i++) { + for ($i = 0; $i < 6; $i++) + { sleep(1); echo "Testserver slow output $i\n"; } diff --git a/test/it_url_server.php b/test/it_url_server.php index d8049b1..b113be1 100644 --- a/test/it_url_server.php +++ b/test/it_url_server.php @@ -14,13 +14,15 @@ register_shutdown_function( usleep(100000); stream_set_blocking($pipes[2], 0); -function server_output() { +function server_output() +{ $result = array(); while (($result[] = trim(fgets($GLOBALS['pipes'][2])))) {}; return array_filter($result); } -function handle_server($args) { +function handle_server($args) +{ $res = true; foreach ((array)$args as $arg) $res = $res && $arg; |