Skip to content

Commit

Permalink
Samples (they want to be tests so bad)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Scott Lewis committed Dec 24, 2012
1 parent eb161ed commit 865c629
Showing 1 changed file with 46 additions and 7 deletions.
53 changes: 46 additions & 7 deletions examples/sample.lua
@@ -1,12 +1,51 @@
-- Note that you must be in the files directory for this to work (i.e. `cd examples`): require 'luarocks.require'
package.cpath = package.cpath .. ";../pkg/?.so" require 'mruby'


require "mruby" print(
mruby.run(" puts 'Hello, World!' ") == 0
)


mruby.run(" puts 'Hello, World!' " ) print('-=-=-=-=-=-=-==-=-=-=-=--=-=-')
-- print(

print(
-- ) mruby.run('') == 0
)

print('-=-=-=-=-=-=-==-=-=-=-=--=-=-')

print(
mruby.run('asifbdbdsflbdslbaibidsabifabbsydifh') == 1
)

print('-=-=-=-=-=-=-==-=-=-=-=--=-=-')

print(
mruby.eval(" 'Hello, World!' ") == 'Hello, World!'
)

print('-=-=-=-=-=-=-==-=-=-=-=--=-=-')

print(
mruby.eval("123") == 123
)

print('-=-=-=-=-=-=-==-=-=-=-=--=-=-')

print(
mruby.eval("50 + 50") + 100 == 200
)

print('-=-=-=-=-=-=-==-=-=-=-=--=-=-')

print(
mruby.eval(" puts 'Hello, World!' ") == nil
)

print('-=-=-=-=-=-=-==-=-=-=-=--=-=-')

print(
mruby.eval(" 'Hello, ' ") .. 'World!' == 'Hello, World!'
)




-- print( -- print(
Expand Down

0 comments on commit 865c629

Please sign in to comment.