From headius at rubyforge.org Sun Jan 22 02:35:06 2006 From: headius at rubyforge.org (headius@rubyforge.org) Date: Sun, 22 Jan 2006 07:35:06 +0000 Subject: [Rubytests-commit] rubicon/builtin TestBinding.rb Message-ID: <200601220735.k0M7Z6pD030833@rubyforge.org> Update of /var/cvs/rubytests/rubicon/builtin In directory rubyforge.org:/tmp/cvs-serv30825/builtin Modified Files: TestBinding.rb Log Message: added a few simple binding tests Index: TestBinding.rb =================================================================== RCS file: /var/cvs/rubytests/rubicon/builtin/TestBinding.rb,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TestBinding.rb 13 Feb 2004 15:35:13 -0000 1.1.1.1 --- TestBinding.rb 22 Jan 2006 07:35:03 -0000 1.2 *************** *** 4,9 **** class TestBinding < Rubicon::TestCase ! ! end --- 4,26 ---- class TestBinding < Rubicon::TestCase ! def test_binding ! assert Binding ! assert binding ! assert binding.kind_of?(Binding) ! end ! ! def test_eval ! def x ! str = "hello" ! binding ! end ! ! x_binding = x ! ! assert_equal "hello", eval("str", x_binding) ! ! eval("str = 'goodbye'", x_binding) ! assert_equal "goodbye", eval("str", x_binding) ! end end From headius at rubyforge.org Sun Jan 22 06:49:16 2006 From: headius at rubyforge.org (headius@rubyforge.org) Date: Sun, 22 Jan 2006 11:49:16 +0000 Subject: [Rubytests-commit] rubicon/builtin TestBinding.rb Message-ID: <200601221149.k0MBnGpD025634@rubyforge.org> Update of /var/cvs/rubytests/rubicon/builtin In directory rubyforge.org:/tmp/cvs-serv25629/builtin Modified Files: TestBinding.rb Log Message: added a test similar to one in C ruby that fails in JRuby Index: TestBinding.rb =================================================================== RCS file: /var/cvs/rubytests/rubicon/builtin/TestBinding.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestBinding.rb 22 Jan 2006 07:35:03 -0000 1.2 --- TestBinding.rb 22 Jan 2006 11:49:14 -0000 1.3 *************** *** 2,5 **** --- 2,6 ---- require 'rubicon' + # This should probably have some checks for 1.8? class TestBinding < Rubicon::TestCase *************** *** 10,14 **** end ! def test_eval def x str = "hello" --- 11,15 ---- end ! def test_basic_binding def x str = "hello" *************** *** 23,26 **** --- 24,36 ---- assert_equal "goodbye", eval("str", x_binding) end + + def test_lambda_binding + lambda_binding = lambda { + str = "hello" + binding + }.call + + assert_equal "hello", eval("str", lambda_binding) + end end From headius at rubyforge.org Mon Jan 23 00:50:56 2006 From: headius at rubyforge.org (headius@rubyforge.org) Date: Mon, 23 Jan 2006 05:50:56 +0000 Subject: [Rubytests-commit] rubicon/builtin TestBinding.rb Message-ID: <200601230550.k0N5oupD017504@rubyforge.org> Update of /var/cvs/rubytests/rubicon/builtin In directory rubyforge.org:/tmp/cvs-serv17500/builtin Removed Files: TestBinding.rb Log Message: scratch that, I just saw these tests and more are in language/TestEval.rb --- TestBinding.rb DELETED --- From drbrain at segment7.net Mon Jan 23 14:27:59 2006 From: drbrain at segment7.net (Eric Hodel) Date: Mon, 23 Jan 2006 11:27:59 -0800 Subject: [Rubytests-commit] rubicon/builtin TestBinding.rb In-Reply-To: <200601220735.k0M7Z6pD030833@rubyforge.org> References: <200601220735.k0M7Z6pD030833@rubyforge.org> Message-ID: <58D1B5B1-8327-462B-9215-86F6B3EB38BC@segment7.net> On Jan 21, 2006, at 11:35 PM, headius at rubyforge.org wrote: > Update of /var/cvs/rubytests/rubicon/builtin > In directory rubyforge.org:/tmp/cvs-serv30825/builtin > > Modified Files: > TestBinding.rb > Log Message: > added a few simple binding tests > > Index: TestBinding.rb > =================================================================== > RCS file: /var/cvs/rubytests/rubicon/builtin/TestBinding.rb,v > retrieving revision 1.1.1.1 > retrieving revision 1.2 > diff -C2 -d -r1.1.1.1 -r1.2 > *** TestBinding.rb 13 Feb 2004 15:35:13 -0000 1.1.1.1 > --- TestBinding.rb 22 Jan 2006 07:35:03 -0000 1.2 > *************** > *** 4,9 **** > > class TestBinding < Rubicon::TestCase > ! > ! > end > > --- 4,26 ---- > > class TestBinding < Rubicon::TestCase > ! def test_binding > ! assert Binding > ! assert binding > ! assert binding.kind_of?(Binding) > ! end > ! > ! def test_eval > ! def x > ! str = "hello" > ! binding > ! end > ! > ! x_binding = x You don't assert that the lvar str is unavailable to eval without x_binding. > ! assert_equal "hello", eval("str", x_binding) > ! > ! eval("str = 'goodbye'", x_binding) > ! assert_equal "goodbye", eval("str", x_binding) > ! end > end > > > _______________________________________________ > Rubytests-commit mailing list > Rubytests-commit at rubyforge.org > http://rubyforge.org/mailman/listinfo/rubytests-commit -- Eric Hodel - drbrain at segment7.net - http://segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com From drbrain at segment7.net Mon Jan 23 14:28:28 2006 From: drbrain at segment7.net (Eric Hodel) Date: Mon, 23 Jan 2006 11:28:28 -0800 Subject: [Rubytests-commit] rubicon/builtin TestBinding.rb In-Reply-To: <200601221149.k0MBnGpD025634@rubyforge.org> References: <200601221149.k0MBnGpD025634@rubyforge.org> Message-ID: <348AF8F5-9FCB-4DB5-AFAD-3EBF2131F1FF@segment7.net> On Jan 22, 2006, at 3:49 AM, headius at rubyforge.org wrote: > Update of /var/cvs/rubytests/rubicon/builtin > In directory rubyforge.org:/tmp/cvs-serv25629/builtin > > Modified Files: > TestBinding.rb > Log Message: > added a test similar to one in C ruby that fails in JRuby > > Index: TestBinding.rb > =================================================================== > RCS file: /var/cvs/rubytests/rubicon/builtin/TestBinding.rb,v > retrieving revision 1.2 > retrieving revision 1.3 > diff -C2 -d -r1.2 -r1.3 > *** TestBinding.rb 22 Jan 2006 07:35:03 -0000 1.2 > --- TestBinding.rb 22 Jan 2006 11:49:14 -0000 1.3 > *************** > *** 2,5 **** > --- 2,6 ---- > require 'rubicon' > > + # This should probably have some checks for 1.8? > > class TestBinding < Rubicon::TestCase > *************** > *** 10,14 **** > end > > ! def test_eval > def x > str = "hello" > --- 11,15 ---- > end > > ! def test_basic_binding > def x > str = "hello" > *************** > *** 23,26 **** > --- 24,36 ---- > assert_equal "goodbye", eval("str", x_binding) > end > + > + def test_lambda_binding > + lambda_binding = lambda { > + str = "hello" > + binding > + }.call You don't assert that the lvar str is unavailable without lambda_binding. > + assert_equal "hello", eval("str", lambda_binding) > + end > end > > > _______________________________________________ > Rubytests-commit mailing list > Rubytests-commit at rubyforge.org > http://rubyforge.org/mailman/listinfo/rubytests-commit -- Eric Hodel - drbrain at segment7.net - http://segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com