(t *testing.T)
| 1001 | } |
| 1002 | |
| 1003 | func TestClientCheckoutBranchSwitchesBranches(t *testing.T) { |
| 1004 | // Given a repository checked out on feature with a trunk branch |
| 1005 | repo := newTestRepo(t) |
| 1006 | repo.run(t, "commit", "--quiet", "--allow-empty", "-m", "initial commit") |
| 1007 | repo.run(t, "checkout", "--quiet", "-b", "feature") |
| 1008 | |
| 1009 | // When trunk is checked out |
| 1010 | err := repo.client.CheckoutBranch(t.Context(), "trunk") |
| 1011 | |
| 1012 | // Then trunk becomes the current branch |
| 1013 | require.NoError(t, err) |
| 1014 | assert.Equal(t, "trunk", repo.run(t, "branch", "--show-current")) |
| 1015 | } |
| 1016 | |
| 1017 | func TestClientCheckoutBranchReportsMissingBranch(t *testing.T) { |
| 1018 | // Given a repository without the requested branch |
nothing calls this directly
no test coverage detected