| 1 | package commandscip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/command`/ |
| 2 | |
| 3 | import ( |
| 4 | "testingscip-go gomod github.com/golang/go/src go1.16 testing/" |
| 5 | |
| 6 | "github.com/isacikgoz/gitbatch/internal/gitscip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/git`/" |
| 7 | "github.com/stretchr/testify/requirescip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/require`/" |
| 8 | ) |
| 9 | |
| 10 | func TestCheckoutscip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/command`/TestCheckout().(t *testingscip-go gomod github.com/golang/go/src go1.16 testing/.Tscip-go gomod github.com/golang/go/src go1.16 testing/T#) { |
| 11 | opts1 := &CheckoutOptionsscip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/command`/CheckoutOptions#{ |
| 12 | TargetRefscip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/command`/CheckoutOptions#TargetRef.: "master", |
| 13 | CreateIfAbsentscip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/command`/CheckoutOptions#CreateIfAbsent.: false, |
| 14 | CommandModescip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/command`/CheckoutOptions#CommandMode.: ModeLegacyscip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/command`/ModeLegacy., |
| 15 | } |
| 16 | opts2 := &CheckoutOptionsscip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/command`/CheckoutOptions#{ |
| 17 | TargetRefscip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/command`/CheckoutOptions#TargetRef.: "develop", |
| 18 | CreateIfAbsentscip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/command`/CheckoutOptions#CreateIfAbsent.: true, |
| 19 | CommandModescip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/command`/CheckoutOptions#CommandMode.: ModeLegacyscip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/command`/ModeLegacy., |
| 20 | } |
| 21 | |
| 22 | th := gitscip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/git`/.InitTestRepositoryFromLocalscip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/git`/InitTestRepositoryFromLocal().(t) |
| 23 | defer th.CleanUpscip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/git`/TestHelper#CleanUp().(t) |
| 24 | |
| 25 | var tests = []struct { |
| 26 | inp1 *gitscip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/git`/.Repositoryscip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/git`/Repository# |
| 27 | inp2 *CheckoutOptionsscip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/command`/CheckoutOptions# |
| 28 | }{ |
| 29 | {th.Repositoryscip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/git`/TestHelper#Repository., opts1}, |
| 30 | {th.Repositoryscip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/git`/TestHelper#Repository., opts2}, |
| 31 | } |
| 32 | for _, test := range tests { |
| 33 | err := Checkoutscip-go gomod github.com/isacikgoz/gitbatch . `github.com/isacikgoz/gitbatch/internal/command`/Checkout().(test.inp1, test.inp2) |
| 34 | requirescip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.2 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 35 | } |
| 36 | } |