From c816fa9eb81e63cb71b9ed80ebd806547bdfa356 Mon Sep 17 00:00:00 2001 From: "Elf M. Sternberg" Date: Wed, 8 Jul 2015 20:46:36 -0700 Subject: [PATCH] [chore] cleaned up after a lint pass --- test/test_chapter3-cont.coffee | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/test/test_chapter3-cont.coffee b/test/test_chapter3-cont.coffee index acfab74..995287c 100644 --- a/test/test_chapter3-cont.coffee +++ b/test/test_chapter3-cont.coffee @@ -23,12 +23,18 @@ describe "Core interpreter #3: Blocks", -> it "Should handle basic returns blocks", -> expect(lisp read "(block foo (+ 1 (return-from foo 2)))").to.equal(2) it "Should handle complex returns blocks", -> - expect(lisp read "(block foo ((lambda (exit)(* 2 (block foo (* 3 (exit 5)) )) ) (lambda (x) (return-from foo x)) ) )").to.equal(5) + code = "(block foo ((lambda (exit)(* 2 (block foo (* 3 (exit 5)) )) ) (lambda (x) (return-from foo x)) ) )" + expect(lisp read code).to.equal(5) it "Expects an uninitialized return-from to fail", -> expect(-> lisp read "(return-from foo 3)").to.throw("Unknown block label foo") it "Expects to see an obsolete block when called late", -> - expect(-> lisp read "((block foo (lambda (x) (return-from foo x))) 3 )").to.throw("Obsolete continuation") + expect(-> lisp read "((block foo (lambda (x) (return-from foo x))) 3 )") + .to.throw("Obsolete continuation") it "Expects to see an obsolete block when called late", -> - expect(-> lisp read "((block a (* 2 (block b (return-from a (lambda (x) (return-from b x))))) )3 )").to.throw("Obsolete continuation") + blocka = "((block a (* 2 (block b (return-from a (lambda (x) (return-from b x))))) )3 )" + expect(-> lisp read blocka).to.throw("Obsolete continuation") it "Expects to see an obsolete block when called late", -> - expect(-> lisp read "((block a (* 2 (block b (return-from a (lambda (x) (return-from a x))))) ) 3 )").to.throw("Obsolete continuation") + blockb = "((block a (* 2 (block b (return-from a (lambda (x) (return-from a x))))) ) 3 )" + expect(-> lisp read blockb).to.throw("Obsolete continuation") + +