(t *testing.T)
| 442 | } |
| 443 | |
| 444 | func TestLocIsCorrectOnError(t *testing.T) { |
| 445 | l := NewState() |
| 446 | if err := l.Load(strings.NewReader(` |
| 447 | a = 3 - 3 |
| 448 | b = 3 / q -- line 3; errs! |
| 449 | `), "test", ""); err != nil { |
| 450 | t.Errorf("Unexpected error! Got %v", err) |
| 451 | } |
| 452 | err := l.ProtectedCall(0, 0, 0) |
| 453 | if err == nil { |
| 454 | t.Errorf("Expected error! Got none... :(") |
| 455 | } else { |
| 456 | if err.Error() != "runtime error: [string \"test\"]:3: attempt to perform arithmetic on a nil value" { |
| 457 | t.Errorf("Wrong error reported: %v", err) |
| 458 | } |
| 459 | } |
| 460 | } |
nothing calls this directly
no test coverage detected