Add support for the Go programming language.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12108 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
09f14197ac
commit
5af2978f77
259 changed files with 16159 additions and 14 deletions
58
Examples/test-suite/go/exception_order_runme.go
Normal file
58
Examples/test-suite/go/exception_order_runme.go
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
package main
|
||||
|
||||
import "strings"
|
||||
import . "./exception_order"
|
||||
|
||||
func main() {
|
||||
a := NewA()
|
||||
|
||||
func() {
|
||||
defer func() {
|
||||
e := recover()
|
||||
if strings.Index(e.(string), "E1") == -1 {
|
||||
panic(e.(string))
|
||||
}
|
||||
}()
|
||||
a.Foo()
|
||||
}()
|
||||
|
||||
func() {
|
||||
defer func() {
|
||||
e := recover()
|
||||
if strings.Index(e.(string), "E2") == -1 {
|
||||
panic(e.(string))
|
||||
}
|
||||
}()
|
||||
a.Bar()
|
||||
}()
|
||||
|
||||
func() {
|
||||
defer func() {
|
||||
e := recover()
|
||||
if e.(string) != "postcatch unknown" {
|
||||
panic("bad exception order")
|
||||
}
|
||||
}()
|
||||
a.Foobar()
|
||||
}()
|
||||
|
||||
func() {
|
||||
defer func() {
|
||||
e := recover()
|
||||
if strings.Index(e.(string), "E1") == -1 {
|
||||
panic(e.(string))
|
||||
}
|
||||
}()
|
||||
a.Barfoo(1)
|
||||
}()
|
||||
|
||||
func() {
|
||||
defer func() {
|
||||
e := recover()
|
||||
if strings.Index(e.(string), "E2") == -1 {
|
||||
panic(e.(string))
|
||||
}
|
||||
}()
|
||||
a.Barfoo(2)
|
||||
}()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue