MCPcopy Index your code
hub / github.com/cloudquery/cloudquery / TestFindMaxCommonVersion

Function TestFindMaxCommonVersion

cli/cmd/sync_test.go:580–599  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

578}
579
580func TestFindMaxCommonVersion(t *testing.T) {
581 cases := []struct {
582 name string
583 givePlugin []int
584 giveCLI []int
585 want int
586 }{
587 {name: "support_less", givePlugin: []int{1, 2, 3}, giveCLI: []int{1, 2}, want: 2},
588 {name: "support_same", givePlugin: []int{1, 2, 3}, giveCLI: []int{1, 2, 3}, want: 3},
589 {name: "support_more", givePlugin: []int{1, 2, 3}, giveCLI: []int{2, 3, 4}, want: 3},
590 {name: "support_only_lower", givePlugin: []int{3, 4, 5}, giveCLI: []int{6, 7}, want: -1},
591 {name: "support_only_higher", givePlugin: []int{3, 4, 5}, giveCLI: []int{1, 2}, want: -2},
592 }
593 for _, tc := range cases {
594 t.Run(tc.name, func(t *testing.T) {
595 got := findMaxCommonVersion(tc.givePlugin, tc.giveCLI)
596 assert.Equal(t, tc.want, got)
597 })
598 }
599}
600
601func TestSync_IsolatedPluginEnvironmentsInCloud(t *testing.T) {
602 configs := []struct {

Callers

nothing calls this directly

Calls 2

findMaxCommonVersionFunction · 0.85
RunMethod · 0.80

Tested by

no test coverage detected