php5 test coverage

This commit is contained in:
z7zmey 2018-02-14 17:28:20 +02:00
parent d40cdc5426
commit 75f952ad03
3 changed files with 1973 additions and 1821 deletions

16
diff
View File

@ -420,9 +420,17 @@
420 420
421 421
422 422
-423
424 424
425 425
-426
427 427
-428
-429
-430
-431
-432
-433
434 434
435 435
436 436
@ -482,14 +490,6 @@
528 528
-423
-426
-428
-429
-430
-431
-432
-433
-437 -437
-442 -442
-445 -445

3790
log

File diff suppressed because it is too large Load Diff

View File

@ -61,6 +61,9 @@ CAD;
CAD; CAD;
<<<"CAD" <<<"CAD"
hello hello
CAD;
<<<"CAD"
hello $world
CAD; CAD;
<<<'CAD' <<<'CAD'
hello $world hello $world
@ -294,8 +297,8 @@ CAD;
yield; yield;
yield $a; yield $a;
yield $a => $b; yield $a => $b;
yield 1; yield Foo::class;
yield $a => 1; yield $a => Foo::class;
(array)$a; (array)$a;
(boolean)$a; (boolean)$a;
@ -405,6 +408,8 @@ CAD;
static $a = namespace\Foo; static $a = namespace\Foo;
static $a = \Foo; static $a = \Foo;
static $a = array(); static $a = array();
static $a = array(1 => 1, 2);
static $a = [1, 2 => 2][0];
` `
expectedParams := []node.Node{ expectedParams := []node.Node{
@ -539,6 +544,15 @@ CAD;
&stmt.Expression{ &stmt.Expression{
Expr: &scalar.String{Value: "\thello\n"}, Expr: &scalar.String{Value: "\thello\n"},
}, },
&stmt.Expression{
Expr: &scalar.Encapsed{
Parts: []node.Node{
&scalar.EncapsedStringPart{Value: "\thello "},
&expr.Variable{VarName: &node.Identifier{Value: "$world"}},
&scalar.EncapsedStringPart{Value: "\n"},
},
},
},
&stmt.Expression{ &stmt.Expression{
Expr: &scalar.String{Value: "\thello $world\n"}, Expr: &scalar.String{Value: "\thello $world\n"},
}, },
@ -2432,13 +2446,27 @@ CAD;
}, },
&stmt.Expression{ &stmt.Expression{
Expr: &expr.Yield{ Expr: &expr.Yield{
Value: &scalar.Lnumber{Value: "1"}, Value: &expr.ClassConstFetch{
Class: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
ConstantName: &node.Identifier{Value: "class"},
},
}, },
}, },
&stmt.Expression{ &stmt.Expression{
Expr: &expr.Yield{ Expr: &expr.Yield{
Key: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Key: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Value: &scalar.Lnumber{Value: "1"}, Value: &expr.ClassConstFetch{
Class: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
ConstantName: &node.Identifier{Value: "class"},
},
}, },
}, },
&stmt.Expression{ &stmt.Expression{
@ -3360,6 +3388,50 @@ CAD;
}, },
}, },
}, },
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.Array{
Items: []node.Node{
&expr.ArrayItem{
ByRef: false,
Key: &scalar.Lnumber{Value: "1"},
Val: &scalar.Lnumber{Value: "1"},
},
&expr.ArrayItem{
ByRef: false,
Val: &scalar.Lnumber{Value: "2"},
},
},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.ArrayDimFetch{
Variable: &expr.ShortArray{
Items: []node.Node{
&expr.ArrayItem{
ByRef: false,
Val: &scalar.Lnumber{Value: "1"},
},
&expr.ArrayItem{
ByRef: false,
Key: &scalar.Lnumber{Value: "2"},
Val: &scalar.Lnumber{Value: "2"},
},
},
},
Dim: &scalar.Lnumber{Value: "0"},
},
},
},
},
}, },
} }