From 2fc0671d82f1092f857c3834eeea0bebae0b6e39 Mon Sep 17 00:00:00 2001 From: kldzj Date: Thu, 18 May 2023 01:35:10 +0200 Subject: [PATCH] add marshal test for `RepositoryTag` --- github/repos_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/github/repos_test.go b/github/repos_test.go index e86d80796f8..992ec418749 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -3506,3 +3506,29 @@ func TestRequiredStatusCheck_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestRepositoryTag_Marshal(t *testing.T) { + testJSONMarshal(t, &RepositoryTag{}, "{}") + + u := &RepositoryTag{ + Name: String("v0.1"), + Commit: &Commit{ + SHA: String("sha"), + URL: String("url"), + }, + ZipballURL: String("zball"), + TarballURL: String("tball"), + } + + want := `{ + "name": "v0.1", + "commit": { + "sha": "sha", + "url": "url" + }, + "zipball_url": "zball", + "tarball_url": "tball" + }` + + testJSONMarshal(t, u, want) +}