github.com/Konstantin8105/c4go@v0.0.0-20240505174241-768bb1c65a51/ast/c4go_error_node_test.go (about) 1 package ast 2 3 import ( 4 "fmt" 5 "testing" 6 ) 7 8 func TestC4GoErrorNode1(t *testing.T) { 9 var c C4goErrorNode 10 tcs := []func(){ 11 func() { c.AddChild(c) }, 12 func() { _ = c.Address() }, 13 func() { _ = c.Children() }, 14 func() { _ = c.Position() }, 15 } 16 17 for index, tc := range tcs { 18 t.Run(fmt.Sprintf("%v", index), func(t *testing.T) { 19 defer func() { 20 if r := recover(); r == nil { 21 t.Errorf("Cannot found panic") 22 } 23 }() 24 tc() 25 }) 26 } 27 }