issue #8: update tests

This commit is contained in:
z7zmey
2018-04-10 15:23:13 +03:00
parent 343896d019
commit 6f7834eb6b
76 changed files with 1596 additions and 534 deletions

View File

@@ -43,10 +43,14 @@ func TestReference(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)
}
@@ -70,10 +74,14 @@ func TestReferenceNew(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)
}
@@ -104,10 +112,14 @@ func TestReferenceArgs(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)
}
@@ -125,10 +137,14 @@ func TestAssign(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)
}
@@ -146,10 +162,14 @@ func TestBitwiseAnd(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)
}
@@ -167,10 +187,14 @@ func TestBitwiseOr(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)
}
@@ -188,10 +212,14 @@ func TestBitwiseXor(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)
}
@@ -209,10 +237,14 @@ func TestConcat(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)
}
@@ -230,10 +262,14 @@ func TestDiv(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)
}
@@ -251,10 +287,14 @@ func TestMinus(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)
}
@@ -272,10 +312,14 @@ func TestMod(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)
}
@@ -293,10 +337,14 @@ func TestMul(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)
}
@@ -314,10 +362,14 @@ func TestPlus(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)
}
@@ -335,10 +387,14 @@ func TestPow(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)
}
@@ -356,10 +412,14 @@ func TestShiftLeft(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)
}
@@ -377,9 +437,13 @@ func TestShiftRight(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)
}