projects
/
m6w6
/
ext-psi
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
history
|
raw
|
HEAD
PHP 8 compatibility
[m6w6/ext-psi]
/
tests
/
parser
/
validate007.phpt
1
--TEST--
2
validate types
3
--FILE--
4
===TEST===
5
<?php
6
7
function validate($check, $psi) {
8
if ($check !== psi_validate_string($psi)) {
9
printf("Assertion failed!\nExpected: %s\n\n%s\n\n",
10
$check ? "true" : "false", $psi);
11
}
12
}
13
14
validate(true,
15
<<<PSI
16
struct a {
17
int i;
18
}
19
struct b {
20
long l;
21
}
22
typedef struct b b;
23
union v {
24
struct a a;
25
b b;
26
struct {
27
double d;
28
} s;
29
union {
30
long l;
31
double d;
32
} u;
33
}
34
PSI
35
);
36
37
?>
38
===DONE===
39
--EXPECTF--
40
===TEST===
41
===DONE===