(t *testing.T, input string)
| 710 | func (assertAnError) Error() string { return "assert an error" } |
| 711 | |
| 712 | func catchCompletionCaret(t *testing.T, input string) (string, int, int) { |
| 713 | t.Helper() |
| 714 | line := 1 |
| 715 | offset := 0 |
| 716 | for i, r := range input { |
| 717 | if r == '|' { |
| 718 | return input[:i] + input[i+1:], line, offset |
| 719 | } |
| 720 | if r == '\n' { |
| 721 | line++ |
| 722 | offset = 0 |
| 723 | continue |
| 724 | } |
| 725 | if r <= 0xFFFF { |
| 726 | offset++ |
| 727 | } else { |
| 728 | offset += 2 |
| 729 | } |
| 730 | } |
| 731 | t.Fatalf("missing caret marker in %q", input) |
| 732 | return "", 0, 0 |
| 733 | } |
| 734 | |
| 735 | func hasCompletionCandidateText(candidates []base.Candidate, text string) bool { |
| 736 | for _, candidate := range candidates { |
no test coverage detected