Skip to content

Commit a97ffa7

Browse files
committed
Add test for resource JSON marshaling (google#2783)
Relates to: google#55.
1 parent f1bd218 commit a97ffa7

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

‎github/repos_test.go‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3506,3 +3506,29 @@ func TestRequiredStatusCheck_Marshal(t *testing.T) {
35063506

35073507
testJSONMarshal(t, u, want)
35083508
}
3509+
3510+
func TestRepositoryTag_Marshal(t *testing.T) {
3511+
testJSONMarshal(t, &RepositoryTag{}, "{}")
3512+
3513+
u := &RepositoryTag{
3514+
Name: String("v0.1"),
3515+
Commit: &Commit{
3516+
SHA: String("sha"),
3517+
URL: String("url"),
3518+
},
3519+
ZipballURL: String("zball"),
3520+
TarballURL: String("tball"),
3521+
}
3522+
3523+
want := `{
3524+
"name": "v0.1",
3525+
"commit": {
3526+
"sha": "sha",
3527+
"url": "url"
3528+
},
3529+
"zipball_url": "zball",
3530+
"tarball_url": "tball"
3531+
}`
3532+
3533+
testJSONMarshal(t, u, want)
3534+
}

0 commit comments

Comments
 (0)