(t *testing.T)
| 13 | ) |
| 14 | |
| 15 | func TestHasSuspiciousTrailingNewline(t *testing.T) { |
| 16 | t.Parallel() |
| 17 | |
| 18 | tests := []struct { |
| 19 | name string |
| 20 | input string |
| 21 | suspicious bool |
| 22 | }{ |
| 23 | {name: "NoTrailingNewline", input: "token", suspicious: false}, |
| 24 | {name: "SingleTrailingLF", input: "token\n", suspicious: true}, |
| 25 | {name: "SingleTrailingCRLF", input: "token\r\n", suspicious: true}, |
| 26 | {name: "SingleTrailingCR", input: "token\r", suspicious: true}, |
| 27 | {name: "MultilineValue", input: "line1\nline2\n", suspicious: false}, |
| 28 | } |
| 29 | |
| 30 | for _, tt := range tests { |
| 31 | t.Run(tt.name, func(t *testing.T) { |
| 32 | t.Parallel() |
| 33 | |
| 34 | require.Equal(t, tt.suspicious, hasSuspiciousTrailingNewline(tt.input)) |
| 35 | }) |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | func TestReadInvocationStdin(t *testing.T) { |
| 40 | t.Parallel() |
nothing calls this directly
no test coverage detected