fix: most of the template blocks
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package template_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"git.max-richter.dev/max/marka/registry"
|
||||
@@ -20,6 +21,10 @@ func TestExtractBlocks(t *testing.T) {
|
||||
t.FailNow()
|
||||
}
|
||||
|
||||
for i, b := range templateBlocks {
|
||||
fmt.Printf("Block#%d: %q\n", i, b.GetContent())
|
||||
}
|
||||
|
||||
expected := []template.Block{
|
||||
{
|
||||
Type: template.MatchingBlock,
|
||||
@@ -58,14 +63,11 @@ func TestExtractBlocks(t *testing.T) {
|
||||
{Type: template.MatchingBlock},
|
||||
{Type: template.DataBlock, Path: "name", Codec: "text"},
|
||||
{Type: template.MatchingBlock},
|
||||
{Type: template.DataBlock, Path: "keywords", Codec: "hashtags", Optional: true},
|
||||
{Type: template.MatchingBlock},
|
||||
{Type: template.DataBlock, Path: "description", Codec: "text"},
|
||||
{Type: template.MatchingBlock},
|
||||
{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) {
|
||||
|
Reference in New Issue
Block a user