-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Julien Pivotto <[email protected]>
- Loading branch information
1 parent
8d1c9f8
commit b6d7542
Showing
2 changed files
with
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1418,3 +1418,19 @@ func TestUnmarshalURL(t *testing.T) { | |
t.Fatalf("URL not properly unmarshaled in YAML, got '%s'", u.String()) | ||
} | ||
} | ||
|
||
func TestMarshalURLWithSecret(t *testing.T) { | ||
var u URL | ||
err := yaml.Unmarshal([]byte("http://foo:[email protected]"), &u) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
|
||
b, err := yaml.Marshal(u) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
if strings.TrimSpace(string(b)) != "http://foo:[email protected]" { | ||
t.Fatalf("URL not properly marshaled in YAML, got '%s'", string(b)) | ||
} | ||
} |