mirror of
https://github.com/PeterCamilleri/fOOrth
synced 2024-11-16 07:47:56 +01:00
Changed emit to .emit and corrected tests.
This commit is contained in:
parent
5e441d7802
commit
b8f5f0935f
2 changed files with 11 additions and 5 deletions
|
@ -38,10 +38,13 @@ class StdioLibraryTester < MiniTest::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_the_emit
|
||||
foorth_output(' 65 emit', "A")
|
||||
foorth_output('126 emit', "~")
|
||||
foorth_output(' 65 .emit', "A")
|
||||
foorth_output('126 .emit', "~")
|
||||
|
||||
foorth_utf8_output('255 emit', [195, 191])
|
||||
foorth_utf8_output('255 .emit', [195, 191])
|
||||
|
||||
foorth_output(' "A123" .emit', "A")
|
||||
foorth_raises('1+1i .emit')
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -30,8 +30,11 @@ module XfOOrth
|
|||
|
||||
#Print out a single character.
|
||||
#[obj] emit []; print out the object as a character.
|
||||
Object.create_shared_method('emit', TosSpec, [],
|
||||
Numeric.create_shared_method('.emit', TosSpec, [],
|
||||
&lambda {|vm| print self.to_foorth_c})
|
||||
String.create_shared_method('.emit', TosSpec, [],
|
||||
&lambda {|vm| print self.to_foorth_c})
|
||||
Complex.create_shared_method('.emit', TosSpec, [:stub])
|
||||
|
||||
#Get a string from the console.
|
||||
# [] accept [string]; gets a string from the console.
|
||||
|
|
Loading…
Reference in a new issue