(t *testing.T)
| 1678 | } |
| 1679 | |
| 1680 | func TestParsePushDefault(t *testing.T) { |
| 1681 | tests := []struct { |
| 1682 | value string |
| 1683 | want PushDefault |
| 1684 | }{ |
| 1685 | {value: "nothing", want: PushDefaultNothing}, |
| 1686 | {value: "current", want: PushDefaultCurrent}, |
| 1687 | {value: "upstream", want: PushDefaultUpstream}, |
| 1688 | {value: "tracking", want: PushDefaultTracking}, |
| 1689 | {value: "simple", want: PushDefaultSimple}, |
| 1690 | {value: "matching", want: PushDefaultMatching}, |
| 1691 | } |
| 1692 | |
| 1693 | for _, tt := range tests { |
| 1694 | t.Run(tt.value, func(t *testing.T) { |
| 1695 | // Given a supported push.default value |
| 1696 | value := tt.value |
| 1697 | |
| 1698 | // When it is parsed |
| 1699 | pushDefault, err := ParsePushDefault(value) |
| 1700 | |
| 1701 | // Then the matching typed value is returned |
| 1702 | require.NoError(t, err) |
| 1703 | assert.Equal(t, tt.want, pushDefault) |
| 1704 | }) |
| 1705 | } |
| 1706 | } |
| 1707 | |
| 1708 | func TestParsePushDefaultReportsUnknownValue(t *testing.T) { |
| 1709 | // Given an unsupported push.default value |
nothing calls this directly
no test coverage detected