refactoring: update scanner tests

This commit is contained in:
Vadym Slizov 2020-12-20 14:39:37 +02:00
parent 286dd50319
commit eda7ae1c87
No known key found for this signature in database
GPG Key ID: AEA2A9388EF42A4A

View File

@ -386,8 +386,7 @@ func TestShebang(t *testing.T) {
tkn := lexer.Lex()
assert.Equal(t, tkn.ID, token.T_DNUMBER)
l := len(tkn.FreeFloating)
for _, tt := range tkn.FreeFloating[:l-1] {
for _, tt := range tkn.FreeFloating {
actual = append(actual, string(tt.Value))
}
@ -1137,8 +1136,7 @@ func TestCommentEnd(t *testing.T) {
tkn := lexer.Lex()
l := len(tkn.FreeFloating)
actual := tkn.FreeFloating[:l-1]
actual := tkn.FreeFloating
for _, v := range actual {
v.Position = nil
}
@ -1169,8 +1167,7 @@ func TestCommentNewLine(t *testing.T) {
tkn := lexer.Lex()
l := len(tkn.FreeFloating)
actual := tkn.FreeFloating[:l-1]
actual := tkn.FreeFloating
for _, v := range actual {
v.Position = nil
}
@ -1201,8 +1198,7 @@ func TestCommentNewLine1(t *testing.T) {
tkn := lexer.Lex()
l := len(tkn.FreeFloating)
actual := tkn.FreeFloating[:l-1]
actual := tkn.FreeFloating
for _, v := range actual {
v.Position = nil
}
@ -1233,8 +1229,7 @@ func TestCommentNewLine2(t *testing.T) {
tkn := lexer.Lex()
l := len(tkn.FreeFloating)
actual := tkn.FreeFloating[:l-1]
actual := tkn.FreeFloating
for _, v := range actual {
v.Position = nil
}
@ -1266,8 +1261,7 @@ func TestCommentWithPhpEndTag(t *testing.T) {
tkn := lexer.Lex()
l := len(tkn.FreeFloating)
actual := tkn.FreeFloating[:l-1]
actual := tkn.FreeFloating
for _, v := range actual {
v.Position = nil
}
@ -1299,8 +1293,7 @@ func TestInlineComment(t *testing.T) {
tkn := lexer.Lex()
l := len(tkn.FreeFloating)
actual := tkn.FreeFloating[:l-1]
actual := tkn.FreeFloating
for _, v := range actual {
v.Position = nil
}
@ -1332,8 +1325,7 @@ func TestInlineComment2(t *testing.T) {
tkn := lexer.Lex()
l := len(tkn.FreeFloating)
actual := tkn.FreeFloating[:l-1]
actual := tkn.FreeFloating
for _, v := range actual {
v.Position = nil
}
@ -1369,8 +1361,7 @@ func TestEmptyInlineComment(t *testing.T) {
tkn := lexer.Lex()
l := len(tkn.FreeFloating)
actual := tkn.FreeFloating[:l-1]
actual := tkn.FreeFloating
for _, v := range actual {
v.Position = nil
}
@ -1402,8 +1393,7 @@ func TestEmptyInlineComment2(t *testing.T) {
tkn := lexer.Lex()
l := len(tkn.FreeFloating)
actual := tkn.FreeFloating[:l-1]
actual := tkn.FreeFloating
for _, v := range actual {
v.Position = nil
}
@ -1428,8 +1418,7 @@ func TestMethodCallTokens(t *testing.T) {
},
}
tkn := lexer.Lex()
l := len(tkn.FreeFloating)
actual := tkn.FreeFloating[:l-1]
actual := tkn.FreeFloating
for _, v := range actual {
v.Position = nil
}
@ -1442,8 +1431,7 @@ func TestMethodCallTokens(t *testing.T) {
},
}
tkn = lexer.Lex()
l = len(tkn.FreeFloating)
actual = tkn.FreeFloating[:l-1]
actual = tkn.FreeFloating
for _, v := range actual {
v.Position = nil
}
@ -1456,8 +1444,7 @@ func TestMethodCallTokens(t *testing.T) {
},
}
tkn = lexer.Lex()
l = len(tkn.FreeFloating)
actual = tkn.FreeFloating[:l-1]
actual = tkn.FreeFloating
for _, v := range actual {
v.Position = nil
}
@ -1470,8 +1457,7 @@ func TestMethodCallTokens(t *testing.T) {
},
}
tkn = lexer.Lex()
l = len(tkn.FreeFloating)
actual = tkn.FreeFloating[:l-1]
actual = tkn.FreeFloating
for _, v := range actual {
v.Position = nil
}
@ -1484,8 +1470,7 @@ func TestMethodCallTokens(t *testing.T) {
},
}
tkn = lexer.Lex()
l = len(tkn.FreeFloating)
actual = tkn.FreeFloating[:l-1]
actual = tkn.FreeFloating
for _, v := range actual {
v.Position = nil
}
@ -1498,8 +1483,7 @@ func TestMethodCallTokens(t *testing.T) {
},
}
tkn = lexer.Lex()
l = len(tkn.FreeFloating)
actual = tkn.FreeFloating[:l-1]
actual = tkn.FreeFloating
for _, v := range actual {
v.Position = nil
}
@ -1512,8 +1496,7 @@ func TestMethodCallTokens(t *testing.T) {
},
}
tkn = lexer.Lex()
l = len(tkn.FreeFloating)
actual = tkn.FreeFloating[:l-1]
actual = tkn.FreeFloating
for _, v := range actual {
v.Position = nil
}
@ -1537,8 +1520,7 @@ func TestYieldFromTokens(t *testing.T) {
},
}
tkn := lexer.Lex()
l := len(tkn.FreeFloating)
actual := tkn.FreeFloating[:l-1]
actual := tkn.FreeFloating
for _, v := range actual {
v.Position = nil
}
@ -1551,8 +1533,7 @@ func TestYieldFromTokens(t *testing.T) {
},
}
tkn = lexer.Lex()
l = len(tkn.FreeFloating)
actual = tkn.FreeFloating[:l-1]
actual = tkn.FreeFloating
for _, v := range actual {
v.Position = nil
}