Skip to content

Commit 7cde0e0

Browse files
committedFeb 16, 2015
Add test for failed parse
1 parent 2290b93 commit 7cde0e0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎lispy/lispy_test.go

+11
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,14 @@ func TestDivisionByZero(t *testing.T) {
6666
}
6767
}
6868
}
69+
70+
func TestFailedParse(t *testing.T) {
71+
l := InitLispy()
72+
defer CleanLispy(l)
73+
c := "The quick brown fox jumps over the very lazy dog."
74+
got := l.ReadEval(c, false)
75+
if got.ltype != lvalErrType || got.err != lerrParseFail {
76+
t.Errorf("ReadEval input: \"%s\" returned ltype %s, num %d, err %s, actually expected lerrParseFail",
77+
c, ltypeString(got), got.num, lerrString(got))
78+
}
79+
}

0 commit comments

Comments
 (0)