nolint:funlen
(t *testing.T)
| 13 | |
| 14 | //nolint:funlen |
| 15 | func TestDecodeError(t *testing.T) { |
| 16 | examples := []struct { |
| 17 | desc string |
| 18 | doc [3]string |
| 19 | msg string |
| 20 | expected string |
| 21 | }{ |
| 22 | { |
| 23 | desc: "no context", |
| 24 | doc: [3]string{"", "morning", ""}, |
| 25 | msg: "this is wrong", |
| 26 | expected: ` |
| 27 | 1| morning |
| 28 | | ~~~~~~~ this is wrong`, |
| 29 | }, |
| 30 | { |
| 31 | desc: "one line", |
| 32 | doc: [3]string{"good ", "morning", " everyone"}, |
| 33 | msg: "this is wrong", |
| 34 | expected: ` |
| 35 | 1| good morning everyone |
| 36 | | ~~~~~~~ this is wrong`, |
| 37 | }, |
| 38 | { |
| 39 | desc: "exactly 3 lines", |
| 40 | doc: [3]string{`line1 |
| 41 | line2 |
| 42 | line3 |
| 43 | before `, "highlighted", ` after |
| 44 | post line 1 |
| 45 | post line 2 |
| 46 | post line 3`}, |
| 47 | msg: "this is wrong", |
| 48 | expected: ` |
| 49 | 1| line1 |
| 50 | 2| line2 |
| 51 | 3| line3 |
| 52 | 4| before highlighted after |
| 53 | | ~~~~~~~~~~~ this is wrong |
| 54 | 5| post line 1 |
| 55 | 6| post line 2 |
| 56 | 7| post line 3`, |
| 57 | }, |
| 58 | { |
| 59 | desc: "more than 3 lines", |
| 60 | doc: [3]string{`should not be seen1 |
| 61 | should not be seen2 |
| 62 | line1 |
| 63 | line2 |
| 64 | line3 |
| 65 | before `, "highlighted", ` after |
| 66 | post line 1 |
| 67 | post line 2 |
| 68 | post line 3 |
| 69 | should not be seen3 |
| 70 | should not be seen4`}, |
| 71 | msg: "this is wrong", |
| 72 | expected: ` |
nothing calls this directly
no test coverage detected
searching dependent graphs…