issue #8: update tests
This commit is contained in:
@@ -29,10 +29,14 @@ func TestSimpleVar(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -52,10 +56,14 @@ func TestSimpleVarOneChar(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -76,10 +84,14 @@ func TestSimpleVarEndsEcapsed(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -100,10 +112,14 @@ func TestStringVarCurveOpen(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -127,10 +143,14 @@ func TestSimpleVarPropertyFetch(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -150,10 +170,14 @@ func TestDollarOpenCurlyBraces(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -176,10 +200,14 @@ func TestDollarOpenCurlyBracesDimNumber(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -203,9 +231,13 @@ func TestCurlyOpenMethodCall(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -34,10 +34,14 @@ LBL;
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -62,10 +66,14 @@ LBL;
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -88,10 +96,14 @@ LBL;
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -110,10 +122,14 @@ CAD;
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -136,9 +152,13 @@ CAD;
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -23,9 +23,13 @@ func TestMagicConstant(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -37,10 +37,14 @@ func TestLNumber(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -55,10 +59,14 @@ func TestDNumber(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -73,10 +81,14 @@ func TestFloat(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -91,10 +103,14 @@ func TestBinaryLNumber(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -109,10 +125,14 @@ func TestBinaryDNumber(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -127,10 +147,14 @@ func TestHLNumber(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -145,9 +169,13 @@ func TestHDNumber(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -22,10 +22,14 @@ func TestDoubleQuotedScalarString(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
func TestDoubleQuotedScalarStringWithEscapedVar(t *testing.T) {
|
||||
@@ -39,10 +43,14 @@ func TestDoubleQuotedScalarStringWithEscapedVar(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -59,10 +67,14 @@ func TestMultilineDoubleQuotedScalarString(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -77,10 +89,14 @@ func TestSingleQuotedScalarString(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
@@ -97,9 +113,13 @@ func TestMultilineSingleQuotedScalarString(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
actual, _, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php7parser.Parse()
|
||||
actual := php7parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
|
||||
actual, _, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
|
||||
php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php")
|
||||
php5parser.Parse()
|
||||
actual = php5parser.GetRootNode()
|
||||
assertEqual(t, expected, actual)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user