issue #8: update tests
This commit is contained in:
@@ -40,10 +40,14 @@ func TestArray(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)
|
||||
}
|
||||
|
||||
@@ -60,10 +64,14 @@ func TestBool(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)
|
||||
}
|
||||
|
||||
@@ -80,10 +88,14 @@ func TestBoolShort(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 TestDouble(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)
|
||||
}
|
||||
|
||||
@@ -120,10 +136,14 @@ func TestCastFloat(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)
|
||||
}
|
||||
|
||||
@@ -140,10 +160,14 @@ func TestInt(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)
|
||||
}
|
||||
|
||||
@@ -160,10 +184,14 @@ func TestIntShort(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)
|
||||
}
|
||||
|
||||
@@ -180,10 +208,14 @@ func TestObject(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)
|
||||
}
|
||||
|
||||
@@ -200,10 +232,14 @@ func TestString(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)
|
||||
}
|
||||
|
||||
@@ -220,9 +256,13 @@ func TestUnset(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