fix: some bug

This commit is contained in:
Max Richter
2025-09-28 20:08:21 +02:00
parent 57ea1f6e3e
commit d35f3e5e2e
5 changed files with 24 additions and 15 deletions

View File

@@ -3,8 +3,6 @@ package template_test
import (
"testing"
"fmt"
"git.max-richter.dev/max/marka/registry"
"git.max-richter.dev/max/marka/template"
)
@@ -67,15 +65,13 @@ func TestExtractBlocks(t *testing.T) {
{Type: template.DataBlock, Path: "recipeIngredient", Codec: "list", ListTemplate: "- { . }"},
{Type: template.MatchingBlock},
{Type: template.DataBlock, Path: "recipeInstructions", Codec: "list", ListTemplate: "{ @index }. { . }"},
{Type: template.MatchingBlock},
}
if len(templateBlocks) != len(expected) {
t.Fatalf("expected %d blocks, got %d", len(expected), len(templateBlocks))
}
fmt.Printf("%+v\n", templateBlocks[0]);
fmt.Printf("Content: %q\n", templateBlocks[0].GetContent());
for i, b := range templateBlocks {
exp := expected[i]
if b.Type != exp.Type {