(t *testing.T)
| 217 | } |
| 218 | |
| 219 | func TestGeneratePromptRemovesXMLComments(t *testing.T) { |
| 220 | compiler := NewCompiler() |
| 221 | |
| 222 | // Note: With the hybrid runtime-import approach, workflows without imports use runtime-import |
| 223 | // which means generatePrompt emits a runtime-import macro, not inline content |
| 224 | // XML comments are removed at runtime by runtime_import.cjs |
| 225 | data := &WorkflowData{ |
| 226 | MarkdownContent: `# Workflow Title |
| 227 | |
| 228 | This is some content. |
| 229 | <!-- This comment should be removed from the prompt --> |
| 230 | More content here. |
| 231 | |
| 232 | <!-- Another comment |
| 233 | that spans multiple lines |
| 234 | should also be removed --> |
| 235 | |
| 236 | Final content.`, |
| 237 | ImportedFiles: []string{}, // No imports, so will use runtime-import |
| 238 | ImportInputs: nil, |
| 239 | } |
| 240 | |
| 241 | var yaml strings.Builder |
| 242 | compiler.generatePrompt(&yaml, data, false, nil) |
| 243 | |
| 244 | output := yaml.String() |
| 245 | |
| 246 | // With runtime-import (no imports), the output should contain the runtime-import macro |
| 247 | // XML comments will be removed at runtime by runtime_import.cjs |
| 248 | if !strings.Contains(output, "{{#runtime-import") { |
| 249 | t.Error("Expected runtime-import macro in prompt generation output for workflow without imports") |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | func TestSplitContentIntoChunks(t *testing.T) { |
| 254 | // Test short content - should result in single chunk |
nothing calls this directly
no test coverage detected