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

Function TestCommentEndFile

node/t_node_test.go:2733–2755  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2731}
2732
2733func TestCommentEndFile(t *testing.T) {
2734 src := `<? //comment at the end)`
2735
2736 expected := &node.Root{
2737 Position: &position.Position{
2738 StartLine: -1,
2739 EndLine: -1,
2740 StartPos: -1,
2741 EndPos: -1,
2742 },
2743 Stmts: []node.Node{},
2744 }
2745
2746 php7parser := php7.NewParser([]byte(src), "7.4")
2747 php7parser.Parse()
2748 actual := php7parser.GetRootNode()
2749 assert.DeepEqual(t, expected, actual)
2750
2751 php5parser := php5.NewParser([]byte(src), "5.6")
2752 php5parser.Parse()
2753 actual = php5parser.GetRootNode()
2754 assert.DeepEqual(t, expected, actual)
2755}

Callers

nothing calls this directly

Calls 4

ParseMethod · 0.95
GetRootNodeMethod · 0.95
NewParserFunction · 0.92
NewParserFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…