From ec615d48827ad39bff082e5e48d7194c3a5b9b4b Mon Sep 17 00:00:00 2001 From: Jon Rafkind Date: Tue, 21 Apr 2009 23:41:50 +0000 Subject: [PATCH] add some function tests svn: r14580 --- collects/tests/honu/basic.honu | 42 ++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/collects/tests/honu/basic.honu b/collects/tests/honu/basic.honu index b05716e989..90486092b1 100644 --- a/collects/tests/honu/basic.honu +++ b/collects/tests/honu/basic.honu @@ -13,7 +13,41 @@ obj test(t, a, b){ } } -var x = 3; -const y = 2; -test("x = 3", x, 3); -test("y = 2", y, 2); +obj test1(){ + var x = 3; + const y = 2; + test("x = 3", x, 3); + test("y = 2", y, 2); +} + +obj test2(){ + obj foo(){ + 1; + } + + obj x1(){ + obj x(){ + 2; + } + } + + (-> obj) x2(){ + obj x(){ + 3; + } + } + + /* + var anonymous_foo = obj x(){ + 2; + }; + */ + + var anonymous_foo = x2(); + + test("foo() = 1", foo(), 1); + test("anonymous_foo = 2", anonymous_foo(), 2); +} + +test1(); +test2();