1
0
mirror of https://github.com/danog/liquid.git synced 2024-11-26 21:14:45 +01:00

Rename some files

This commit is contained in:
Oliver Steele 2017-06-25 11:49:42 -04:00
parent 58395a8ab4
commit bcef4dc8e1
2 changed files with 5 additions and 20 deletions

View File

@ -1,5 +1,3 @@
//go:generate ragel -Z liquid.rl
package main
import (
@ -10,13 +8,7 @@ import (
"github.com/stretchr/testify/require"
)
var tests = []struct{ in, out string }{
{"pre</head>post", "pre:insertion:</head>post"},
{"pre:insertion:</head>post", "pre:insertion:</head>post"},
{"post", ":insertion:post"},
}
func TestLiquid(t *testing.T) {
func TestChunkParser(t *testing.T) {
tokens := ScanChunks("pre{%if 1%}left{{x}}right{%endif%}post", "")
// fmt.Println("tokens =", tokens)
ast, err := Parse(tokens)
@ -25,10 +17,8 @@ func TestLiquid(t *testing.T) {
err = ast.Render(os.Stdout, nil)
require.NoError(t, err)
fmt.Println()
require.True(t, true)
return
for _, test := range chunkTests {
tokens := ScanChunks(test.in, "")
ast, err := Parse(tokens)
@ -38,12 +28,7 @@ func TestLiquid(t *testing.T) {
}
}
type chunkTest struct {
in string
expected string
}
var chunkTests = []chunkTest{
chunkTest{"{{var}}", "value"},
chunkTest{"{{x}}", "1"},
var chunkTests = []struct{in, expected string}{
{"{{var}}", "value"},
{"{{x}}", "1"},
}