Corrected the naming of the nil methods.

This commit is contained in:
Peter Camilleri 2015-01-12 17:02:43 -05:00
parent cdfbed54de
commit 936cfbad62
2 changed files with 12 additions and 12 deletions

View file

@ -148,17 +148,17 @@ class StandardLibraryTester < MiniTest::Unit::TestCase
end end
def test_is_nil def test_is_nil
foorth_equal("false =nil", [false]) foorth_equal("false nil=", [false])
foorth_equal("true =nil", [false]) foorth_equal("true nil=", [false])
foorth_equal("42 =nil", [false]) foorth_equal("42 nil=", [false])
foorth_equal("nil =nil", [true]) foorth_equal("nil nil=", [true])
end end
def test_is_not_nil def test_is_not_nil
foorth_equal("false <>nil", [true]) foorth_equal("false nil<>", [true])
foorth_equal("true <>nil", [true]) foorth_equal("true nil<>", [true])
foorth_equal("42 <>nil", [true]) foorth_equal("42 nil<>", [true])
foorth_equal("nil <>nil", [false]) foorth_equal("nil nil<>", [false])
end end

View file

@ -61,15 +61,15 @@ module XfOOrth
# Some nil operation words # Some nil operation words
# [a] =nil [true/false] # [a] =nil [true/false]
Object.create_shared_method('=nil', TosSpec, [], Object.create_shared_method('nil=', TosSpec, [],
&lambda {|vm| vm.push(false); }) &lambda {|vm| vm.push(false); })
NilClass.create_shared_method('=nil', TosSpec, [], NilClass.create_shared_method('nil=', TosSpec, [],
&lambda {|vm| vm.push(true); }) &lambda {|vm| vm.push(true); })
# [a] <>nil [true/false] # [a] <>nil [true/false]
Object.create_shared_method('<>nil', TosSpec, [], Object.create_shared_method('nil<>', TosSpec, [],
&lambda {|vm| vm.push(true); }) &lambda {|vm| vm.push(true); })
NilClass.create_shared_method('<>nil', TosSpec, [], NilClass.create_shared_method('nil<>', TosSpec, [],
&lambda {|vm| vm.push(false); }) &lambda {|vm| vm.push(false); })