(t *testing.T)
| 475 | } |
| 476 | |
| 477 | func TestPCallAfterFail(t *testing.T) { |
| 478 | L := NewState() |
| 479 | defer L.Close() |
| 480 | errFn := L.NewFunction(func(L *LState) int { |
| 481 | L.RaiseError("error!") |
| 482 | return 0 |
| 483 | }) |
| 484 | changeError := L.NewFunction(func(L *LState) int { |
| 485 | L.Push(errFn) |
| 486 | err := L.PCall(0, 0, nil) |
| 487 | if err != nil { |
| 488 | L.RaiseError("A New Error") |
| 489 | } |
| 490 | return 0 |
| 491 | }) |
| 492 | L.Push(changeError) |
| 493 | err := L.PCall(0, 0, nil) |
| 494 | errorIfFalse(t, strings.Contains(err.Error(), "A New Error"), "error not propogated correctly") |
| 495 | } |
| 496 | |
| 497 | func TestRegistryFixedOverflow(t *testing.T) { |
| 498 | state := NewState() |
nothing calls this directly
no test coverage detected
searching dependent graphs…