()
| 1622 | |
| 1623 | #[tokio::test] |
| 1624 | async fn test_parse_defines_single_quoted() { |
| 1625 | let backend = create_test_backend(); |
| 1626 | let defines = backend.parse_defines("<?php\ndefine('MY_CONST', 42);\n"); |
| 1627 | let names: Vec<&str> = defines.iter().map(|(n, _, _)| n.as_str()).collect(); |
| 1628 | assert_eq!(names, vec!["MY_CONST"]); |
| 1629 | // The offset should point to the `define` keyword on line 1. |
| 1630 | assert!(defines[0].1 > 0, "define keyword offset should be non-zero"); |
| 1631 | // The value should be extracted from the second argument. |
| 1632 | assert_eq!(defines[0].2.as_deref(), Some("42")); |
| 1633 | } |
| 1634 | |
| 1635 | #[tokio::test] |
| 1636 | async fn test_parse_defines_double_quoted() { |
nothing calls this directly
no test coverage detected