Add more tests
所有检测均成功
The build was successful.

这个提交包含在:
2018-08-07 17:16:28 +02:00
父节点 7711bdb6bc
当前提交 c419b8605d
共有 4 个文件被更改,包括 95 次插入0 次删除

40
tests/printf_test.aer 普通文件
查看文件

@@ -0,0 +1,40 @@
class Main {
private $s = 'monkey';
private $t = 'many monkeys';
private $n = 43951789;
private $u = -43951789;
private $c = 65;
public function __construct() {
$this->testMonkey();
$this->testNumbers();
}
private function testMonkey() {
printf("[%s]\n", $this->s);
printf("[%10s]\n", $this->s);
printf("[%-10s]\n", $this->s);
printf("[%010s]\n", $this->s);
printf("[%'#10s]\n", $this->s);
printf("[%10.10s]\n", $this->t);
}
private function testNumbers() {
printf("%%b = '%b'\n", $this->n);
printf("%%c = '%c'\n", $this->c);
printf("%%d = '%d'\n", $this->n);
printf("%%e = '%e'\n", $this->n);
printf("%%u = '%u'\n", $this->n);
printf("%%u = '%u'\n", $this->u);
printf("%%f = '%f'\n", $this->n);
printf("%%o = '%o'\n", $this->n);
printf("%%s = '%s'\n", $this->n);
printf("%%x = '%x'\n", $this->n);
printf("%%X = '%X'\n", $this->n);
printf("%%+d = '%+d'\n", $this->n);
printf("%%+d = '%+d'\n", $this->u);
}
}
new Main();