MCPcopy Index your code
hub / github.com/google/go-github / TestProjectV2ItemContent_Marshal

Function TestProjectV2ItemContent_Marshal

github/projects_test.go:1666–1729  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1664}
1665
1666func TestProjectV2ItemContent_Marshal(t *testing.T) {
1667 t.Parallel()
1668
1669 t.Run("issue", func(t *testing.T) {
1670 t.Parallel()
1671
1672 content := ProjectV2ItemContent{
1673 Issue: &Issue{
1674 Number: Ptr(42),
1675 Title: Ptr("Bug report"),
1676 State: Ptr("open"),
1677 },
1678 }
1679
1680 want := `{
1681 "number":42,
1682 "state":"open",
1683 "title":"Bug report"
1684 }`
1685
1686 testJSONMarshalOnly(t, content, want)
1687 testJSONMarshalOnly(t, &content, want)
1688 })
1689
1690 t.Run("pull request", func(t *testing.T) {
1691 t.Parallel()
1692
1693 content := ProjectV2ItemContent{
1694 PullRequest: &PullRequest{
1695 Number: Ptr(99),
1696 Title: Ptr("Feature addition"),
1697 State: Ptr("closed"),
1698 },
1699 }
1700
1701 want := `{
1702 "number":99,
1703 "state":"closed",
1704 "title":"Feature addition"
1705 }`
1706
1707 testJSONMarshalOnly(t, content, want)
1708 testJSONMarshalOnly(t, &content, want)
1709 })
1710
1711 t.Run("draft issue", func(t *testing.T) {
1712 t.Parallel()
1713
1714 content := ProjectV2ItemContent{
1715 DraftIssue: &ProjectV2DraftIssue{
1716 Title: Ptr("Draft task"),
1717 Body: Ptr("Work in progress"),
1718 },
1719 }
1720
1721 want := `{
1722 "body":"Work in progress",
1723 "title":"Draft task"

Callers

nothing calls this directly

Calls 3

testJSONMarshalOnlyFunction · 0.85
PtrFunction · 0.70
RunMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…