mirror of
https://github.com/PeterCamilleri/fOOrth
synced 2024-11-16 07:47:56 +01:00
Corrected the naming of the nil methods.
This commit is contained in:
parent
cdfbed54de
commit
936cfbad62
2 changed files with 12 additions and 12 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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); })
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue