(t *testing.T)
| 849 | } |
| 850 | |
| 851 | func TestSingleLineFieldValue(t *testing.T) { |
| 852 | tests := []struct { |
| 853 | name string |
| 854 | in string |
| 855 | want string |
| 856 | }{ |
| 857 | {name: "no line breaks", in: "plain", want: "plain"}, |
| 858 | {name: "newline becomes space", in: "a\nb", want: "a b"}, |
| 859 | {name: "CRLF becomes a single space", in: "a\r\nb", want: "a b"}, |
| 860 | {name: "lone carriage return is dropped", in: "a\rb", want: "ab"}, |
| 861 | {name: "consecutive newlines", in: "a\n\nb", want: "a b"}, |
| 862 | } |
| 863 | |
| 864 | for _, tt := range tests { |
| 865 | t.Run(tt.name, func(t *testing.T) { |
| 866 | assert.Equal(t, tt.want, singleLineFieldValue(tt.in)) |
| 867 | }) |
| 868 | } |
| 869 | } |
nothing calls this directly
no test coverage detected