mirror of https://github.com/go-python/gopy.git
bind: test __len__
Change-Id: I17dbafd6014bcc2ca6faafd46a4bd50fb1693a33
This commit is contained in:
parent
1fd60af396
commit
45b32c5643
|
@ -141,3 +141,14 @@ for i,o in enumerate(objs):
|
||||||
print "--- len(vs):",len(vs)
|
print "--- len(vs):",len(vs)
|
||||||
del objs
|
del objs
|
||||||
print "--- testing GC... [ok]"
|
print "--- testing GC... [ok]"
|
||||||
|
|
||||||
|
print "--- testing array..."
|
||||||
|
arr = hi.GetIntArray()
|
||||||
|
print "arr:",arr
|
||||||
|
print "len(arr):",len(arr)
|
||||||
|
|
||||||
|
print "--- testing slice..."
|
||||||
|
s = hi.GetIntSlice()
|
||||||
|
print "slice:",s
|
||||||
|
print "len(slice):",len(s)
|
||||||
|
|
||||||
|
|
|
@ -137,6 +137,12 @@ hi.Couple{P1=hi.Person{Name="mom", Age=50}, P2=hi.Person{Name="bob", Age=51}}
|
||||||
--- len(objs): 100000
|
--- len(objs): 100000
|
||||||
--- len(vs): 100000
|
--- len(vs): 100000
|
||||||
--- testing GC... [ok]
|
--- testing GC... [ok]
|
||||||
|
--- testing array...
|
||||||
|
arr: [2]int{1, 2}
|
||||||
|
len(arr): 2
|
||||||
|
--- testing slice...
|
||||||
|
slice: []int{1, 2}
|
||||||
|
len(slice): 2
|
||||||
`)
|
`)
|
||||||
buf := new(bytes.Buffer)
|
buf := new(bytes.Buffer)
|
||||||
cmd = exec.Command("python2", "./test.py")
|
cmd = exec.Command("python2", "./test.py")
|
||||||
|
|
Loading…
Reference in New Issue