2018-06-30 21:05:59 +00:00
|
|
|
package node_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2019-02-13 20:18:07 +00:00
|
|
|
"gotest.tools/assert"
|
|
|
|
|
2018-06-30 21:05:59 +00:00
|
|
|
"github.com/z7zmey/php-parser/position"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestPosition(t *testing.T) {
|
2019-03-10 21:37:01 +00:00
|
|
|
expected := position.NewPosition(1, 1, 0, 1)
|
2018-06-30 21:05:59 +00:00
|
|
|
for _, n := range nodes {
|
|
|
|
n.SetPosition(expected)
|
|
|
|
actual := n.GetPosition()
|
2019-02-13 20:18:07 +00:00
|
|
|
assert.DeepEqual(t, expected, actual)
|
2018-06-30 21:05:59 +00:00
|
|
|
}
|
|
|
|
}
|