Permalink
Browse files

Samples (they want to be tests so bad)

  • Loading branch information...
Ryan Scott Lewis
Ryan Scott Lewis committed Dec 24, 2012
1 parent eb161ed commit 865c629a3403975b2893fe92e90751e123d13965
Showing with 46 additions and 7 deletions.
  1. +46 −7 examples/sample.lua
View
@@ -1,12 +1,51 @@
--- Note that you must be in the files directory for this to work (i.e. `cd examples`):
-package.cpath = package.cpath .. ";../pkg/?.so"
+require 'luarocks.require'
+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(

0 comments on commit 865c629

Please sign in to comment.