(t *testing.T, L *LState, f LGFunction, pattern string)
| 66 | } |
| 67 | |
| 68 | func 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 | } |
no test coverage detected
searching dependent graphs…