-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SWAT-595] Add support for multiline Field values (#85)
* Support multiline fields with escaped newlines * Added e2e test for multiline field * Update input description * Added unit test Co-authored-by: Laszlo Pusok <[email protected]>
- Loading branch information
1 parent
29c0977
commit b38da23
Showing
4 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package main | ||
|
||
import ( | ||
"reflect" | ||
"testing" | ||
) | ||
|
||
func Test_parseFields(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
s string | ||
wantFs []Field | ||
}{ | ||
{ | ||
name: "Newline in release notes", | ||
s: "Release notes|line1\\nline2", | ||
wantFs: []Field{{Title: "Release notes", Value: "line1\nline2"}}, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if gotFs := parseFields(tt.s); !reflect.DeepEqual(gotFs, tt.wantFs) { | ||
t.Errorf("parseFields() = %v, want %v", gotFs, tt.wantFs) | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters