Browse Source

New test for 'is' statement.

release/v0.1
Rafal Kupiec 1 year ago
parent
commit
543191c1b2
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
2 changed files with 44 additions and 0 deletions
  1. +30
    -0
      tests/is_statement.aer
  2. +14
    -0
      tests/is_statement.exp

+ 30
- 0
tests/is_statement.aer 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
- 0
tests/is_statement.exp 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)

Loading…
Cancel
Save