Ruby examples added.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@853 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
aef09f73b8
commit
5df7c82b59
42 changed files with 1804 additions and 7 deletions
|
|
@ -6,7 +6,9 @@
|
|||
#define ICONST 42
|
||||
#define FCONST 2.1828
|
||||
#define CCONST 'x'
|
||||
#define CCONST2 '\n'
|
||||
#define SCONST "Hello World"
|
||||
#define SCONST2 "\"Hello World\""
|
||||
|
||||
/* This should work just fine */
|
||||
#define EXPR ICONST + 3*(FCONST)
|
||||
|
|
|
|||
|
|
@ -2,13 +2,15 @@
|
|||
|
||||
require 'example'
|
||||
|
||||
print "ICONST = ", Example::ICONST, " (should be 42)\n"
|
||||
print "FCONST = ", Example::FCONST, " (should be 2.1828)\n"
|
||||
print "CCONST = ", Example::CCONST, " (should be 'x')\n"
|
||||
print "SCONST = ", Example::SCONST, " (should be 'Hello World')\n"
|
||||
print "EXPR = ", Example::EXPR, " (should be 48.5484)\n"
|
||||
print "iconst = ", Example::Iconst, " (should be 37)\n"
|
||||
print "fconst = ", Example::Fconst, " (should be 3.14)\n"
|
||||
print "ICONST = ", Example::ICONST, " (should be 42)\n"
|
||||
print "FCONST = ", Example::FCONST, " (should be 2.1828)\n"
|
||||
print "CCONST = ", Example::CCONST, " (should be 'x')\n"
|
||||
print "CCONST2 = ", Example::CCONST2, " (this should be on a new line)\n"
|
||||
print "SCONST = ", Example::SCONST, " (should be 'Hello World')\n"
|
||||
print "SCONST2 = ", Example::SCONST2, " (should be '\"Hello World\"')\n"
|
||||
print "EXPR = ", Example::EXPR, " (should be 48.5484)\n"
|
||||
print "iconst = ", Example::Iconst, " (should be 37)\n"
|
||||
print "fconst = ", Example::Fconst, " (should be 3.14)\n"
|
||||
|
||||
begin
|
||||
print "EXTERN = ", Example::EXTERN, " (Arg! This shouldn't print anything)\n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue