1
0
mirror of https://github.com/danog/liquid.git synced 2024-11-26 22:24:39 +01:00

Rename source.txt -> source.liquid; add env.liquid

This commit is contained in:
Oliver Steele 2022-02-12 11:09:51 +08:00
parent ae6b280abe
commit ddc4e45c83
3 changed files with 6 additions and 3 deletions

View File

@ -63,7 +63,7 @@ func TestMain(t *testing.T) {
stdin = os.Stdin stdin = os.Stdin
buf = &bytes.Buffer{} buf = &bytes.Buffer{}
stdout = buf stdout = buf
os.Args = []string{"liquid", "testdata/source.txt"} os.Args = []string{"liquid", "testdata/source.liquid"}
main() main()
require.Contains(t, buf.String(), "file system") require.Contains(t, buf.String(), "file system")
@ -72,7 +72,7 @@ func TestMain(t *testing.T) {
exitCode := 0 exitCode := 0
exit = func(n int) { exitCalled = true; exitCode = n } exit = func(n int) { exitCalled = true; exitCode = n }
os.Args = []string{"liquid", "testdata/source.txt"} os.Args = []string{"liquid", "testdata/source.liquid"}
main() main()
require.Equal(t, 0, exitCode) require.Equal(t, 0, exitCode)
@ -104,7 +104,7 @@ func TestMain(t *testing.T) {
require.Contains(t, buf.String(), "defined") require.Contains(t, buf.String(), "defined")
// multiple args // multiple args
os.Args = []string{"liquid", "testdata/source.txt", "file2"} os.Args = []string{"liquid", "testdata/source.liquid", "file2"}
buf = &bytes.Buffer{} buf = &bytes.Buffer{}
stderr = buf stderr = buf
main() main()

3
cmd/liquid/testdata/env.liquid vendored Normal file
View File

@ -0,0 +1,3 @@
PWD={{ PWD }}
HOME={{ HOME }}
USER={{ USER }}