MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / test_parse_defines_single_quoted

Function test_parse_defines_single_quoted

tests/integration/parser.rs:1624–1633  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1622
1623#[tokio::test]
1624async 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]
1636async fn test_parse_defines_double_quoted() {

Callers

nothing calls this directly

Calls 5

create_test_backendFunction · 0.85
parse_definesMethod · 0.80
iterMethod · 0.80
as_strMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected