bind: test getter/setter

This commit is contained in:
Sebastien Binet 2015-07-29 11:44:37 +02:00
parent ba3a48a31b
commit d6d6d01ece
2 changed files with 19 additions and 2 deletions

View File

@ -45,3 +45,14 @@ print p.String()
print "--- doc(p):"
print p.__doc__
print "--- p.Name = \"foo\"..."
p.Name = "foo"
print "--- p.Age = 42..."
p.Age = 42
print "--- p.String()..."
print p.String()
print "--- p.Age:", p.Age
print "--- p.Name:",p.Name

View File

@ -80,8 +80,8 @@ Person is a simple struct
--- p = hi.Person()...
['Age', 'Greet', 'Name', 'String', '__class__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']
--- p.Name: None
--- p.Age: None
--- p.Name:
--- p.Age: 0
--- doc(hi.Greet):
Greet() str
@ -94,6 +94,12 @@ hi.Person{Name="", Age=0}
--- doc(p):
Person is a simple struct
--- p.Name = "foo"...
--- p.Age = 42...
--- p.String()...
hi.Person{Name="foo", Age=42}
--- p.Age: 42
--- p.Name: foo
`)
buf := new(bytes.Buffer)
cmd = exec.Command("python2", "./test.py")