Improvements and perspective from architecture review
This commit is contained in:
parent
ff961c2e84
commit
9428f16cf5
6 changed files with 338 additions and 28 deletions
|
|
@ -60,6 +60,13 @@ def test_pipeline_passes_previous_output_to_next_function():
|
|||
assert result.content == "Final"
|
||||
|
||||
|
||||
def test_pipeline_separator_inside_quotes_is_literal():
|
||||
result = render_document_functions('{{mkt:text.replace "a|b" "|" "/"}}')
|
||||
|
||||
assert result.valid
|
||||
assert result.content == "a/b"
|
||||
|
||||
|
||||
def test_context_variables_can_be_used_in_function_arguments():
|
||||
context = ProcessingContext(variables={"title": "Architecture Decision"})
|
||||
|
||||
|
|
@ -75,6 +82,13 @@ def test_validate_document_functions_reports_forbidden_calls():
|
|||
assert result.diagnostics[0].code == "function.forbidden"
|
||||
|
||||
|
||||
def test_validate_document_functions_reports_argument_errors():
|
||||
result = validate_document_functions("{{mkt:text.upper draft unexpected=value}}")
|
||||
|
||||
assert not result.valid
|
||||
assert result.diagnostics[0].code == "function.arguments"
|
||||
|
||||
|
||||
def test_registry_can_expose_custom_function_without_core_rewrite():
|
||||
registry = DocumentFunctionRegistry()
|
||||
registry.register(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue