summaryrefslogtreecommitdiff
path: root/tests/exec.t
blob: 5e021cbf419307759b913025cac1924343edcab5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/www/server/bin/php -qC
<?php

# Tests for getopt in it.class

require 'searchlib/search_test.class';

is(it::exec("echo gna"), "gna\n", "basic exec");
is(it::exec("echo {arg}", 'arg' => 'gna'), "gna\n", "exec with argument");

foreach (array("", "C", "de_CH", "de_CH.utf8") as $locale) {
	setlocale(LC_ALL, $locale);
	$arg = "preüpost";
	if (it::match('utf8', $locale))
		$arg = utf8_encode($arg);
	is(it::exec("echo " . $arg), $arg . "\n", "exec with umlaut (locale '$locale')");
	is(it::exec("echo {arg}", 'arg' => $arg), $arg . "\n", "exec with argument and umlaut (locale '$locale')");
}