generated from racklet/base-repo-layout
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from racklet/quote_output
Quote the files when output
- Loading branch information
Showing
3 changed files
with
34 additions
and
1 deletion.
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,24 @@ | ||
package render | ||
|
||
import "testing" | ||
|
||
func Test_joinQuotedStrings(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
strs []string | ||
want string | ||
}{ | ||
{ | ||
name: "simple", | ||
strs: []string{"foo bar", "bar baz"}, | ||
want: `"foo bar" "bar baz"`, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if got := joinQuotedStrings(tt.strs); got != tt.want { | ||
t.Errorf("joinQuotedStrings() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |