~ubuntu-branches/ubuntu/oneiric/swig1.3/oneiric

« back to all changes in this revision

Viewing changes to Examples/test-suite/lua/smart_pointer_overload_runme.lua

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-12-06 10:27:08 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20071206102708-t37t62i45n595w0e
Tags: 1.3.33-2ubuntu1
* Merge with Debian; remaining changes:
  - Drop support for pike.
  - Use python2.5 instead of python2.4.
  - Clean Runtime/ as well.
  - Force a few environment variables.
* debian/Rules (clean): Remove Lib/ocaml/swigp4.ml.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
require("import")       -- the import fn
 
2
import("smart_pointer_overload")        -- import code
 
3
for k,v in pairs(smart_pointer_overload) do _G[k]=v end -- move to global
 
4
 
 
5
f = Foo()
 
6
b = Bar(f)
 
7
 
 
8
assert(f:test(3) == 1)
 
9
--assert(f:test(3.5) == 2)      -- won't work due to being unable to overloads
 
10
assert(f:test("hello") == 3)
 
11
 
 
12
assert(b:test(3) == 1)
 
13
--assert(b:test(3.5) == 2)      -- won't work due to being unable to overloads
 
14
assert(b:test("hello") == 3)