Still trying to reproduce #154

This commit is contained in:
Neale Pickett 2020-11-02 08:27:19 -08:00
parent 8bc5dfd784
commit 782a8f759b
3 changed files with 12 additions and 3 deletions

View File

@ -174,6 +174,14 @@ func TestFilesystem(t *testing.T) {
BaseFs: afero.NewOsFs(), 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() stdout.Reset()
if err := tp.Run("file", "-dir=testdata/cat1/1", "-file=moo.txt"); err != nil { if err := tp.Run("file", "-dir=testdata/cat1/1", "-file=moo.txt"); err != nil {
t.Error(err) t.Error(err)
@ -181,5 +189,4 @@ func TestFilesystem(t *testing.T) {
if !strings.Contains(stdout.String(), "Moo.") { if !strings.Contains(stdout.String(), "Moo.") {
t.Error("Wrong file pulled", stdout.String()) t.Error("Wrong file pulled", stdout.String())
} }
} }

View File

@ -0,0 +1 @@
moo

View File

@ -7,9 +7,10 @@ fail () {
case $1:$2 in case $1:$2 in
puzzle:) puzzle:)
cat <<'EOT' read answer < answer.txt
cat <<EOT
{ {
"Answers": ["answer"], "Answers": ["$answer"],
"Pre": { "Pre": {
"Authors": ["neale"], "Authors": ["neale"],
"Body": "I am a generated puzzle." "Body": "I am a generated puzzle."