MCPcopy Create free account
hub / github.com/z7zmey/php-parser / TestStringVarNameByteChars

Function TestStringVarNameByteChars

scanner/scanner_test.go:1590–1610  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1588}
1589
1590func TestStringVarNameByteChars(t *testing.T) {
1591 src := "<?php \"$\x80 $\xff\""
1592
1593 lexer := NewLexer([]byte(src))
1594 lv := &lval{}
1595
1596 lexer.Lex(lv)
1597 assert.Equal(t, "\"", lv.Tkn.Value)
1598
1599 lexer.Lex(lv)
1600 assert.Equal(t, "$\x80", lv.Tkn.Value)
1601
1602 lexer.Lex(lv)
1603 assert.Equal(t, " ", lv.Tkn.Value)
1604
1605 lexer.Lex(lv)
1606 assert.Equal(t, "$\xff", lv.Tkn.Value)
1607
1608 lexer.Lex(lv)
1609 assert.Equal(t, "\"", lv.Tkn.Value)
1610}
1611
1612func TestIgnoreControllCharacters(t *testing.T) {
1613 src := "<?php \004 echo $b;"

Callers

nothing calls this directly

Calls 2

LexMethod · 0.95
NewLexerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…