MCPcopy Index your code
hub / github.com/yuin/gopher-lua / errorIfGFuncNotFail

Function errorIfGFuncNotFail

testutils_test.go:68–78  ·  view source on GitHub ↗
(t *testing.T, L *LState, f LGFunction, pattern string)

Source from the content-addressed store, hash-verified

66}
67
68func errorIfGFuncNotFail(t *testing.T, L *LState, f LGFunction, pattern string) {
69 if err := L.GPCall(f, LNil); err != nil {
70 reg := regexp.MustCompile(pattern)
71 if len(reg.FindStringIndex(err.Error())) == 0 {
72 t.Errorf("%v error message '%v' does not contains given pattern string '%v'.", positionString(1), err.Error(), pattern)
73 return
74 }
75 return
76 }
77 t.Errorf("%v LGFunction should fail", positionString(1))
78}

Callers 15

TestCheckIntFunction · 0.85
TestCheckInt64Function · 0.85
TestCheckNumberFunction · 0.85
TestCheckStringFunction · 0.85
TestCheckBoolFunction · 0.85
TestCheckTableFunction · 0.85
TestCheckFunctionFunction · 0.85
TestCheckUserDataFunction · 0.85
TestCheckThreadFunction · 0.85
TestCheckChannelFunction · 0.85
TestCheckTypeFunction · 0.85
TestCheckTypesFunction · 0.85

Calls 3

positionStringFunction · 0.85
ErrorMethod · 0.65
GPCallMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…