New test for 'is' statement.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-06-07 13:19:50 +02:00
parent 6c449dbdbf
commit 543191c1b2
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 44 additions and 0 deletions

30
tests/is_statement.aer Normal file
View File

@ -0,0 +1,30 @@
interface Test0 {}
class Test1 implements Test0 {}
class Test2 extends Test1 {
}
class Program {
void main() {
int[] $q = {1, 2, 3};
float $t = 4;
object $x = new Test1();
var_dump($x is Test0);
var_dump($x is Test1);
var_dump($x is Test2);
var_dump($x is object);
var_dump($x is object[]);
var_dump($x is void);
var_dump($q is void);
var_dump($q is void[]);
var_dump($q is int);
var_dump($q is int[]);
var_dump($q[1] is int);
var_dump($t is int);
var_dump($t is float);
var_dump($t is 4);
}
}

14
tests/is_statement.exp Normal file
View File

@ -0,0 +1,14 @@
bool(TRUE)
bool(TRUE)
bool(FALSE)
bool(TRUE)
bool(FALSE)
bool(FALSE)
bool(FALSE)
bool(FALSE)
bool(FALSE)
bool(TRUE)
bool(TRUE)
bool(FALSE)
bool(TRUE)
bool(TRUE)