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

Function TestDiv

node/expr/binary/t_binary_op_test.go:537–610  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

535}
536
537func TestDiv(t *testing.T) {
538 src := `<? $a / $b;`
539
540 expected := &node.Root{
541 Position: &position.Position{
542 StartLine: 1,
543 EndLine: 1,
544 StartPos: 3,
545 EndPos: 11,
546 },
547 Stmts: []node.Node{
548 &stmt.Expression{
549 Position: &position.Position{
550 StartLine: 1,
551 EndLine: 1,
552 StartPos: 3,
553 EndPos: 11,
554 },
555 Expr: &binary.Div{
556 Position: &position.Position{
557 StartLine: 1,
558 EndLine: 1,
559 StartPos: 3,
560 EndPos: 10,
561 },
562 Left: &expr.Variable{
563 Position: &position.Position{
564 StartLine: 1,
565 EndLine: 1,
566 StartPos: 3,
567 EndPos: 5,
568 },
569 VarName: &node.Identifier{
570 Position: &position.Position{
571 StartLine: 1,
572 EndLine: 1,
573 StartPos: 3,
574 EndPos: 5,
575 },
576 Value: "a",
577 },
578 },
579 Right: &expr.Variable{
580 Position: &position.Position{
581 StartLine: 1,
582 EndLine: 1,
583 StartPos: 8,
584 EndPos: 10,
585 },
586 VarName: &node.Identifier{
587 Position: &position.Position{
588 StartLine: 1,
589 EndLine: 1,
590 StartPos: 8,
591 EndPos: 10,
592 },
593 Value: "b",
594 },

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…