(t *testing.T)
| 390 | } |
| 391 | |
| 392 | func TestCoalesce(t *testing.T) { |
| 393 | src := `<? $a ?? $b;` |
| 394 | |
| 395 | expected := &node.Root{ |
| 396 | Position: &position.Position{ |
| 397 | StartLine: 1, |
| 398 | EndLine: 1, |
| 399 | StartPos: 3, |
| 400 | EndPos: 12, |
| 401 | }, |
| 402 | Stmts: []node.Node{ |
| 403 | &stmt.Expression{ |
| 404 | Position: &position.Position{ |
| 405 | StartLine: 1, |
| 406 | EndLine: 1, |
| 407 | StartPos: 3, |
| 408 | EndPos: 12, |
| 409 | }, |
| 410 | Expr: &binary.Coalesce{ |
| 411 | Position: &position.Position{ |
| 412 | StartLine: 1, |
| 413 | EndLine: 1, |
| 414 | StartPos: 3, |
| 415 | EndPos: 11, |
| 416 | }, |
| 417 | Left: &expr.Variable{ |
| 418 | Position: &position.Position{ |
| 419 | StartLine: 1, |
| 420 | EndLine: 1, |
| 421 | StartPos: 3, |
| 422 | EndPos: 5, |
| 423 | }, |
| 424 | VarName: &node.Identifier{ |
| 425 | Position: &position.Position{ |
| 426 | StartLine: 1, |
| 427 | EndLine: 1, |
| 428 | StartPos: 3, |
| 429 | EndPos: 5, |
| 430 | }, |
| 431 | Value: "a", |
| 432 | }, |
| 433 | }, |
| 434 | Right: &expr.Variable{ |
| 435 | Position: &position.Position{ |
| 436 | StartLine: 1, |
| 437 | EndLine: 1, |
| 438 | StartPos: 9, |
| 439 | EndPos: 11, |
| 440 | }, |
| 441 | VarName: &node.Identifier{ |
| 442 | Position: &position.Position{ |
| 443 | StartLine: 1, |
| 444 | EndLine: 1, |
| 445 | StartPos: 9, |
| 446 | EndPos: 11, |
| 447 | }, |
| 448 | Value: "b", |
| 449 | }, |
nothing calls this directly
no test coverage detected
searching dependent graphs…