diff --git a/cmd/transpile/main_test.go b/cmd/transpile/main_test.go index af48f3b..20351d7 100644 --- a/cmd/transpile/main_test.go +++ b/cmd/transpile/main_test.go @@ -174,6 +174,14 @@ func TestFilesystem(t *testing.T) { BaseFs: afero.NewOsFs(), } + stdout.Reset() + if err := tp.Run("puzzle", "-dir=testdata/cat1/1"); err != nil { + t.Error(err) + } + if !strings.Contains(stdout.String(), "moo") { + t.Error("File not pulled from cwd", stdout.String()) + } + stdout.Reset() if err := tp.Run("file", "-dir=testdata/cat1/1", "-file=moo.txt"); err != nil { t.Error(err) @@ -181,5 +189,4 @@ func TestFilesystem(t *testing.T) { if !strings.Contains(stdout.String(), "Moo.") { t.Error("Wrong file pulled", stdout.String()) } - } \ No newline at end of file diff --git a/cmd/transpile/testdata/cat1/1/answer.txt b/cmd/transpile/testdata/cat1/1/answer.txt new file mode 100644 index 0000000..eec8c88 --- /dev/null +++ b/cmd/transpile/testdata/cat1/1/answer.txt @@ -0,0 +1 @@ +moo diff --git a/cmd/transpile/testdata/cat1/1/mkpuzzle b/cmd/transpile/testdata/cat1/1/mkpuzzle index e61b4a2..161b2e7 100755 --- a/cmd/transpile/testdata/cat1/1/mkpuzzle +++ b/cmd/transpile/testdata/cat1/1/mkpuzzle @@ -7,9 +7,10 @@ fail () { case $1:$2 in puzzle:) - cat <<'EOT' + read answer < answer.txt + cat <