Skip to content

Commit c0f2a15

Browse files
committed
#137 - Add test case for float return type
1 parent 44ecbbb commit c0f2a15

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108

109109
<dir name="return-types">
110110
<file name="false.phpt" role="test"/>
111+
<file name="float.phpt" role="test"/>
111112
<file name="int.phpt" role="test"/>
112113
<file name="mixed.phpt" role="test"/>
113114
</dir>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
--TEST--
2+
Function definition with `float` return type
3+
--SKIPIF--
4+
<?php include(__DIR__ . '/../../skipif.inc'); ?>
5+
--FILE--
6+
<?php
7+
$code =<<<ZEP
8+
function test() -> float { }
9+
ZEP;
10+
11+
$ir = zephir_parse_file($code, '(eval code)');
12+
var_dump($ir);
13+
?>
14+
--EXPECT--
15+
array(1) {
16+
[0]=>
17+
array(6) {
18+
["type"]=>
19+
string(8) "function"
20+
["name"]=>
21+
string(4) "test"
22+
["return-type"]=>
23+
array(6) {
24+
["type"]=>
25+
string(11) "return-type"
26+
["list"]=>
27+
array(1) {
28+
[0]=>
29+
array(6) {
30+
["type"]=>
31+
string(21) "return-type-parameter"
32+
["data-type"]=>
33+
string(6) "double"
34+
["mandatory"]=>
35+
int(0)
36+
["file"]=>
37+
string(11) "(eval code)"
38+
["line"]=>
39+
int(1)
40+
["char"]=>
41+
int(27)
42+
}
43+
}
44+
["void"]=>
45+
int(0)
46+
["file"]=>
47+
string(11) "(eval code)"
48+
["line"]=>
49+
int(1)
50+
["char"]=>
51+
int(27)
52+
}
53+
["file"]=>
54+
string(11) "(eval code)"
55+
["line"]=>
56+
int(1)
57+
["char"]=>
58+
int(9)
59+
}
60+
}

0 commit comments

Comments
 (0)