From 45b32c5643d1c6bb2224e04c099de9063753e836 Mon Sep 17 00:00:00 2001 From: Sebastien Binet Date: Wed, 5 Aug 2015 17:44:49 +0200 Subject: [PATCH] bind: test __len__ Change-Id: I17dbafd6014bcc2ca6faafd46a4bd50fb1693a33 --- _examples/hi/test.py | 11 +++++++++++ main_test.go | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/_examples/hi/test.py b/_examples/hi/test.py index 7b83640..ec922de 100644 --- a/_examples/hi/test.py +++ b/_examples/hi/test.py @@ -141,3 +141,14 @@ for i,o in enumerate(objs): print "--- len(vs):",len(vs) del objs 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) + diff --git a/main_test.go b/main_test.go index a8d2d16..46aa477 100644 --- a/main_test.go +++ b/main_test.go @@ -137,6 +137,12 @@ hi.Couple{P1=hi.Person{Name="mom", Age=50}, P2=hi.Person{Name="bob", Age=51}} --- len(objs): 100000 --- len(vs): 100000 --- 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) cmd = exec.Command("python2", "./test.py")