Skip to content

Commit 6963637

Browse files
committed
add more complex unit test
1 parent 2345995 commit 6963637

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

expression_test.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,42 @@ func TestFindComplexExpressionsInTokens(t *testing.T) {
127127
assertions.True(FindExpressionsInTokens([]Token{token, token2, token3, token4}, []Expression{expression, expression2}))
128128
}
129129

130+
func TestFindComplexExpressionsInTokensOnSecondTime(t *testing.T) {
131+
assertions := assert.New(t)
132+
expression := Expression{
133+
Type: "bracket",
134+
Text: "(",
135+
}
136+
137+
expression2 := Expression{
138+
Type: "bracket",
139+
Text: ")",
140+
}
141+
142+
token := Token{
143+
Type: "bracket",
144+
Position: 1,
145+
Text: "(",
146+
}
147+
token2 := Token{
148+
Type: "bracket",
149+
Position: 2,
150+
Text: "(",
151+
}
152+
token3 := Token{
153+
Type: "bracket",
154+
Position: 3,
155+
Text: ")",
156+
}
157+
token4 := Token{
158+
Type: "bracket",
159+
Position: 4,
160+
Text: "{",
161+
}
162+
163+
assertions.True(FindExpressionsInTokens([]Token{token, token2, token3, token4}, []Expression{expression, expression2}))
164+
}
165+
130166
func TestDoNotFindComplexExpressionsInTokens(t *testing.T) {
131167
assertions := assert.New(t)
132168
expression := Expression{

0 commit comments

Comments
 (0)