UNPKG

meld

Version:

Meld: A template language for LLM prompts

38 lines (23 loc) 1.38 kB
# Integration Test Fix Analysis After examining the API integration tests in `api/integration.test.ts` and relevant code, I've found that the main issue is with how the directives are being structured in the AST. ## Core Issues 1. **Path Directive Structure**: The error suggests the AST node isn't structured correctly. The validator expects a structured node with `identifier` and `value` properties. 2. **AST Parsing**: The Meld parser isn't correctly creating AST nodes with the expected structure for the directives in the test file. ## Potential Solutions 1. **Fix the test content**: Make sure all directive syntax in the test file follows the exact pattern expected by the parser. 2. **Debug the AST generation**: Add logging to see what AST structure is being generated from the test content. ## Test Case Analysis The test case content is: ```meld @path docs = "$PROJECTPATH/docs" @text docPath = "Docs are at ${docs}" ${docPath} ``` This structure should be valid according to the documentation and examples. The issue could be with: 1. Spaces around the equals sign 2. The format of the quoted string 3. The AST generation for path directives ## Recommended Approach 1. Add a simple passing test case with a path directive 2. Compare the AST structure of the passing case with the failing case 3. Fix the test content to match the expected structure