-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathempty_node_test.go
44 lines (35 loc) · 1.01 KB
/
empty_node_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (c) 2017 Opsidian Ltd.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package ast_test
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/conflowio/parsley/ast"
"github.com/conflowio/parsley/parsley"
)
var _ = Describe("EmptyNode", func() {
var (
node ast.EmptyNode
pos parsley.Pos = parsley.Pos(1)
)
JustBeforeEach(func() {
node = ast.EmptyNode(pos)
})
Describe("Methods", func() {
It("Token() should return with the token value", func() {
Expect(node.Token()).To(Equal("EMPTY"))
})
It("Pos() should return with the token value", func() {
Expect(node.Pos()).To(Equal(pos))
})
It("ReaderPos() should return with the reader position", func() {
Expect(node.ReaderPos()).To(Equal(pos))
})
It("String() should return with NIL", func() {
Expect(node.String()).To(Equal("EMPTY{1}"))
})
})
})