| 1 | // Copyright (c) Bartłomiej Płotka @bwplotka |
| 2 | // Licensed under the Apache License 2.0. |
| 3 | |
| 4 | package main_testscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/ |
| 5 | |
| 6 | import ( |
| 7 | "contextscip-go gomod github.com/golang/go/src go1.24.9 context/" |
| 8 | "fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/" |
| 9 | "osscip-go gomod github.com/golang/go/src go1.24.9 os/" |
| 10 | "path/filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/" |
| 11 | "stringsscip-go gomod github.com/golang/go/src go1.24.9 strings/" |
| 12 | "testingscip-go gomod github.com/golang/go/src go1.24.9 testing/" |
| 13 | |
| 14 | "github.com/Masterminds/semverscip-go gomod github.com/Masterminds/semver v1.5.0 `github.com/Masterminds/semver`/" |
| 15 | "github.com/bwplotka/bingo/pkg/bingoscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo/pkg/bingo`/" |
| 16 | "github.com/bwplotka/bingo/pkg/runnerscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo/pkg/runner`/" |
| 17 | "github.com/bwplotka/bingo/pkg/versionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo/pkg/version`/" |
| 18 | "github.com/efficientgo/core/testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/" |
| 19 | ) |
| 20 | |
| 21 | const ( |
| 22 | bingoBinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/bingoBin. = "bingo" |
| 23 | defaultModDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/defaultModDir. = ".bingo" |
| 24 | defaultGoProxyscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/defaultGoProxy. = "https://proxy.golang.org" |
| 25 | ) |
| 26 | |
| 27 | func TestGetListscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/TestGetList().(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 28 | t.Parallelscip-go gomod github.com/golang/go/src go1.24.9 testing/T#Parallel().() |
| 29 | |
| 30 | g := newIsolatedGoEnvscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/newIsolatedGoEnv().(t, defaultGoProxyscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/defaultGoProxy.) |
| 31 | defer g.Closescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#Close().(t) |
| 32 | |
| 33 | for _, isGoProject := range []bool{false, true} { |
| 34 | if ok := t.Runscip-go gomod github.com/golang/go/src go1.24.9 testing/T#Run().(fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.9 fmt/Sprintf().("isGoProject=%v", isGoProject), func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 35 | g.Clearscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#Clear().(t) |
| 36 | |
| 37 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Okscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Ok().(t, osscip-go gomod github.com/golang/go/src go1.24.9 os/.MkdirAllscip-go gomod github.com/golang/go/src go1.24.9 os/MkdirAll().(filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., "newproject"), osscip-go gomod github.com/golang/go/src go1.24.9 os/.ModePermscip-go gomod github.com/golang/go/src go1.24.9 os/ModePerm.)) |
| 38 | p := newTestProjectscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/newTestProject().(t, filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., "newproject"), filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., "testproject"), isGoProject) |
| 39 | p.assertNotChangedscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#assertNotChanged().(t) |
| 40 | |
| 41 | // We manually build bingo binary to make sure GOCACHE will not hit us. |
| 42 | bingoPath := filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., bingoBinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/bingoBin.) |
| 43 | buildInitialGobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/buildInitialGobin().(t, bingoPath) |
| 44 | |
| 45 | // TODO(bwplotka): Add buildable back from array version to normal one. |
| 46 | var prevBinaries []string |
| 47 | for _, tcase := range []struct { |
| 48 | name string |
| 49 | do func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) |
| 50 | |
| 51 | expectBinaries []string |
| 52 | expectSameBinariesAsBefore bool |
| 53 | expectRows []rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row# |
| 54 | }{ |
| 55 | { |
| 56 | name: "get one module by tag on empty project", |
| 57 | do: func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 58 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "github.com/bwplotka/bingo-testmodule/[email protected]")) |
| 59 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "list", "buildable"), g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "list")) |
| 60 | }, |
| 61 | expectRows: []rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#{{namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-v1.0.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}}, |
| 62 | expectBinaries: []string{"buildable-v1.0.0"}, |
| 63 | }, |
| 64 | { |
| 65 | name: "get the same module by tag does not change anything", |
| 66 | do: func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 67 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "github.com/bwplotka/bingo-testmodule/[email protected]")) |
| 68 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "list", "buildable"), g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "list")) |
| 69 | }, |
| 70 | expectRows: []rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#{{namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-v1.0.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}}, |
| 71 | expectSameBinariesAsBefore: true, |
| 72 | }, |
| 73 | { |
| 74 | name: "get the same module by commit does not change anything", |
| 75 | do: func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 76 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "github.com/bwplotka/bingo-testmodule/buildable@4040b74bfd07be764f2ad16ddbf7fba07b247f1c")) |
| 77 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "list", "buildable"), g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "list")) |
| 78 | }, |
| 79 | expectRows: []rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#{{namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-v1.0.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}}, |
| 80 | expectSameBinariesAsBefore: true, |
| 81 | }, |
| 82 | { |
| 83 | name: "get the different module with different tool name by commit", |
| 84 | do: func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 85 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "github.com/bwplotka/bingo-testmodule/buildable2@9d83f47b84c5d9262ecaf649bfa01f0f1cb6ebd2")) |
| 86 | }, |
| 87 | expectRows: []rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#{ |
| 88 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-v1.0.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 89 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable2", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable2-v0.0.0-20221007091238-9d83f47b84c5", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 90 | }, |
| 91 | expectBinaries: []string{"buildable-v1.0.0", "buildable2-v0.0.0-20221007091238-9d83f47b84c5"}, |
| 92 | }, |
| 93 | { |
| 94 | name: "latest tag should upgrade the tool.", |
| 95 | do: func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 96 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "buildable@latest")) |
| 97 | }, |
| 98 | expectRows: []rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#{ |
| 99 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-v1.1.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 100 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable2", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable2-v0.0.0-20221007091238-9d83f47b84c5", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 101 | }, |
| 102 | expectBinaries: []string{"buildable-v1.0.0", "buildable-v1.1.0", "buildable2-v0.0.0-20221007091238-9d83f47b84c5"}, |
| 103 | }, |
| 104 | { |
| 105 | name: "downgrade the tool", |
| 106 | do: func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 107 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "github.com/bwplotka/bingo-testmodule/[email protected]")) |
| 108 | }, |
| 109 | expectRows: []rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#{ |
| 110 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-v1.0.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 111 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable2", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable2-v0.0.0-20221007091238-9d83f47b84c5", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 112 | }, |
| 113 | expectSameBinariesAsBefore: true, |
| 114 | }, |
| 115 | { |
| 116 | name: "get same tool under different name", |
| 117 | do: func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 118 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "-n", "buildable-v2", "github.com/bwplotka/bingo-testmodule/v2/[email protected]")) |
| 119 | }, |
| 120 | expectRows: []rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#{ |
| 121 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-v1.0.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 122 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable-v2", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-v2-v2.0.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/v2/[email protected]"}, |
| 123 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable2", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable2-v0.0.0-20221007091238-9d83f47b84c5", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 124 | }, |
| 125 | expectBinaries: []string{"buildable-v1.0.0", "buildable-v1.1.0", "buildable-v2-v2.0.0", "buildable2-v0.0.0-20221007091238-9d83f47b84c5"}, |
| 126 | }, |
| 127 | { |
| 128 | name: "rename the tool", |
| 129 | do: func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 130 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "-r", "my-buildable-v2", "buildable-v2")) |
| 131 | }, |
| 132 | expectRows: []rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#{ |
| 133 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-v1.0.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 134 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable2", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable2-v0.0.0-20221007091238-9d83f47b84c5", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 135 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "my-buildable-v2", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "my-buildable-v2-v2.0.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/v2/[email protected]"}, |
| 136 | }, |
| 137 | expectBinaries: []string{"buildable-v1.0.0", "buildable-v1.1.0", "buildable-v2-v2.0.0", "buildable2-v0.0.0-20221007091238-9d83f47b84c5", "my-buildable-v2-v2.0.0"}, |
| 138 | }, |
| 139 | { |
| 140 | name: "build as latest", |
| 141 | do: func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 142 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "-l", "buildable")) |
| 143 | }, |
| 144 | expectRows: []rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#{ |
| 145 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-v1.0.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 146 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable2", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable2-v0.0.0-20221007091238-9d83f47b84c5", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 147 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "my-buildable-v2", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "my-buildable-v2-v2.0.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/v2/[email protected]"}, |
| 148 | }, |
| 149 | expectBinaries: []string{"buildable", "buildable-v1.0.0", "buildable-v1.1.0", "buildable-v2-v2.0.0", "buildable2-v0.0.0-20221007091238-9d83f47b84c5", "my-buildable-v2-v2.0.0"}, |
| 150 | }, |
| 151 | { |
| 152 | name: "remove tool", |
| 153 | do: func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 154 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "buildable@none")) |
| 155 | }, |
| 156 | expectRows: []rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#{ |
| 157 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable2", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable2-v0.0.0-20221007091238-9d83f47b84c5", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 158 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "my-buildable-v2", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "my-buildable-v2-v2.0.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/v2/[email protected]"}, |
| 159 | }, |
| 160 | expectSameBinariesAsBefore: true, |
| 161 | }, |
| 162 | { |
| 163 | name: "install array version", |
| 164 | do: func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 165 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "github.com/bwplotka/bingo-testmodule/buildable@39a7f0ae0b1e1e67a75033fc671ccc2c5b3bbddf,v1.0.0,v1.1.0")) |
| 166 | }, |
| 167 | expectRows: []rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#{ |
| 168 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-v0.0.0-20221007091146-39a7f0ae0b1e", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 169 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-v1.0.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 170 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-v1.1.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 171 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable2", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable2-v0.0.0-20221007091238-9d83f47b84c5", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 172 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "my-buildable-v2", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "my-buildable-v2-v2.0.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/v2/[email protected]"}, |
| 173 | }, |
| 174 | expectBinaries: []string{"buildable", "buildable-v0.0.0-20221007091146-39a7f0ae0b1e", "buildable-v1.0.0", "buildable-v1.1.0", "buildable-v2-v2.0.0", "buildable2-v0.0.0-20221007091238-9d83f47b84c5", "my-buildable-v2-v2.0.0"}, |
| 175 | }, |
| 176 | { |
| 177 | name: "get from array version to single one", |
| 178 | do: func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 179 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "[email protected]")) |
| 180 | }, |
| 181 | expectRows: []rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#{ |
| 182 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-v1.1.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 183 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable2", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable2-v0.0.0-20221007091238-9d83f47b84c5", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 184 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "my-buildable-v2", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "my-buildable-v2-v2.0.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/v2/[email protected]"}, |
| 185 | }, |
| 186 | expectSameBinariesAsBefore: true, |
| 187 | }, |
| 188 | { |
| 189 | name: "get from single version back to array", |
| 190 | do: func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 191 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "github.com/bwplotka/bingo-testmodule/buildable@39a7f0ae0b1e1e67a75033fc671ccc2c5b3bbddf,v1.0.0,v1.1.0")) |
| 192 | }, |
| 193 | expectRows: []rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#{ |
| 194 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-v0.0.0-20221007091146-39a7f0ae0b1e", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 195 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-v1.0.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 196 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-v1.1.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 197 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable2", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable2-v0.0.0-20221007091238-9d83f47b84c5", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 198 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "my-buildable-v2", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "my-buildable-v2-v2.0.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/v2/[email protected]"}, |
| 199 | }, |
| 200 | expectSameBinariesAsBefore: true, |
| 201 | }, |
| 202 | { |
| 203 | name: "remove all", |
| 204 | do: func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 205 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "buildable@none")) |
| 206 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "buildable2@none")) |
| 207 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "my-buildable-v2@none")) |
| 208 | |
| 209 | // Check additionally if Makefile was removed. |
| 210 | _, err := osscip-go gomod github.com/golang/go/src go1.24.9 os/.Statscip-go gomod github.com/golang/go/src go1.24.9 os/Stat().(filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., ".bingo", "Variables.mk")) |
| 211 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.NotOkscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/NotOk().(t, err) |
| 212 | }, |
| 213 | expectSameBinariesAsBefore: true, |
| 214 | }, |
| 215 | } { |
| 216 | if ok := t.Runscip-go gomod github.com/golang/go/src go1.24.9 testing/T#Run().(tcase.name, func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 217 | defer p.assertNotChangedscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#assertNotChanged().(t, defaultModDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/defaultModDir.) |
| 218 | |
| 219 | tcase.do(t) |
| 220 | |
| 221 | expectBingoListRowsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/expectBingoListRows().(t, tcase.expectRows, g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "list")) |
| 222 | |
| 223 | binaries := g.existingBinariesscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#existingBinaries().(t) |
| 224 | if tcase.expectSameBinariesAsBefore { |
| 225 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, prevBinaries, g.existingBinariesscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#existingBinaries().(t)) |
| 226 | } else { |
| 227 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, tcase.expectBinaries, g.existingBinariesscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#existingBinaries().(t)) |
| 228 | } |
| 229 | prevBinaries = binaries |
| 230 | }); !ok { |
| 231 | return |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | }); !ok { |
| 236 | return |
| 237 | } |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | func TestGet_Errorsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/TestGet_Errors().(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 242 | // Existing bug - > on names can be case-sensitive but makefile varialbes are not! |
| 243 | |
| 244 | // name: "error cases", |
| 245 | // do: func(t *testing.T) { |
| 246 | // // Installing different tool with name clash should fail |
| 247 | // testutil.NotOk(t, g.ExpectErr(p.root, bingoPath, "get", "github.com/bwplotka/totally-not-bingo/testdata/module/[email protected]")) |
| 248 | // // Installing package with go name should fail. (this is due to clash with go.mod). |
| 249 | // testutil.NotOk(t, g.ExpectErr(p.root, bingoPath, "get", "github.com/something/go")) |
| 250 | // // Naive installing package that would result with `cmd` name fails - different name is suggested. |
| 251 | // testutil.NotOk(t, g.ExpectErr(p.root, bingoPath, "get", "github.com/bwplotka/[email protected]")) |
| 252 | // // Updating f4 to multiple versions with none should fail. |
| 253 | // testutil.NotOk(t, g.ExpectErr(p.root, bingoPath, "get", "[email protected],v1.1.0,none")) |
| 254 | // // Installing by different path that would result in same name |
| 255 | // testutil.NotOk(t, g.ExpectErr(p.root, bingoPath, "get", "github.com/bwplotka/bingo/some/module/buildable")) |
| 256 | // // Removing by path. |
| 257 | // testutil.NotOk(t, g.ExpectErr(p.root, bingoPath, "get", "github.com/bwplotka/bingo/testdata/module/buildable@none")) |
| 258 | // testutil.NotOk(t, g.ExpectErr(p.root, bingoPath, "get", "github.com/bwplotka/bingo/some/module/buildable@none")) |
| 259 | // // Removing non existing tool. |
| 260 | // testutil.NotOk(t, g.ExpectErr(p.root, bingoPath, "get", "buildable2@none")) |
| 261 | // }, |
| 262 | // Get unexisting module |
| 263 | // Rename unexisting tool |
| 264 | // Removing unexisting tool |
| 265 | // Rm by path |
| 266 | // Use g.ExpectErr(p... |
| 267 | // name: "-r rename error cases", |
| 268 | // do: func(t *testing.T) { |
| 269 | // testutil.NotOk(t, g.ExpectErr(p.root, bingoPath, "get", "-r=buildable4", "github.com/bwplotka/bingo/testdata/module/buildable2")) |
| 270 | // testutil.NotOk(t, g.ExpectErr(p.root, bingoPath, "get", "-r=buildable4", "github.com/bwplotka/bingo/testdata/module/[email protected]")) |
| 271 | // testutil.NotOk(t, g.ExpectErr(p.root, bingoPath, "get", "-r=buildable4", "github.com/bwplotka/bingo/testdata/module/buildable2@none")) |
| 272 | // testutil.NotOk(t, g.ExpectErr(p.root, bingoPath, "get", "-r=buildable4", "buildable2@none")) |
| 273 | // testutil.NotOk(t, g.ExpectErr(p.root, bingoPath, "get", "-r=buildable4", "[email protected]")) |
| 274 | // testutil.NotOk(t, g.ExpectErr(p.root, bingoPath, "get", "-r=faillint", "buildable2")) // Renaming to existing name. |
| 275 | // testutil.NotOk(t, g.ExpectErr(p.root, bingoPath, "get", "-r=faiLLint", "buildable2")) // Renaming to existing name (it's not case sensitive). |
| 276 | // testutil.NotOk(t, g.ExpectErr(p.root, bingoPath, "get", "-r", "f3", "x")) // Renaming not existing. |
| 277 | // testutil.NotOk(t, g.ExpectErr(p.root, bingoPath, "get", "-r", "f4", "[email protected],v1.0.0")) |
| 278 | // }, |
| 279 | // { |
| 280 | // name: "get wr_buildable@ccbd4039b94aac79d926ba5eebfe6a132a728ed8 (dowgrade buildable with different replaces - trickier than you think!)", |
| 281 | // do: func(t *testing.T) { |
| 282 | // fmt.Println(g.ExecOutput(t, p.root, bingoPath, "get", "wr_buildable@ccbd4039b94aac79d926ba5eebfe6a132a728ed8")) |
| 283 | // |
| 284 | // // Check if installed tool is what we expect. |
| 285 | // testutil.Equals(t, "module_with_replace.buildable 2.8\n", g.ExecOutput(t, p.root, filepath.Join(g.gobin, "wr_buildable-v0.0.0-20210110214650-ab990d1be30b"))) |
| 286 | // testutil.Equals(t, "module_with_replace.buildable 2.7\n", g.ExecOutput(t, p.root, filepath.Join(g.gobin, "wr_buildable-v0.0.0-20210109165512-ccbd4039b94a"))) |
| 287 | // }, |
| 288 | // expectRows: []row{ |
| 289 | // {name: "buildable", binName: "buildable-v0.0.0-20210109094001-375d0606849d", pkgVersion: "github.com/bwplotka/bingo/testdata/module/[email protected]"}, |
| 290 | // {name: "buildable2", binName: "buildable2-v0.0.0-20210109093942-2e6391144e85", pkgVersion: "github.com/bwplotka/bingo/testdata/module/[email protected]"}, |
| 291 | // {name: "buildable_old", binName: "buildable_old-v0.0.0-20210109093942-2e6391144e85", pkgVersion: "github.com/bwplotka/bingo/testdata/module/[email protected]"}, |
| 292 | // {name: "faillint", binName: "faillint-v1.3.0", pkgVersion: "github.com/fatih/[email protected]"}, |
| 293 | // {name: "go-bindata", binName: "go-bindata-v3.1.1+incompatible", pkgVersion: "github.com/go-bindata/go-bindata/[email protected]+incompatible"}, |
| 294 | // {name: "wr_buildable", binName: "wr_buildable-v0.0.0-20210109165512-ccbd4039b94a", pkgVersion: "github.com/bwplotka/bingo/testdata/module_with_replace/[email protected]"}, |
| 295 | // }, |
| 296 | // expectBinaries: []string{ |
| 297 | // "buildable-v0.0.0-20210109093942-2e6391144e85", "buildable-v0.0.0-20210109094001-375d0606849d", "buildable2-v0.0.0-20210109093942-2e6391144e85", |
| 298 | // "buildable_old-v0.0.0-20210109093942-2e6391144e85", "buildable_old-v0.0.0-20210109094001-375d0606849d", |
| 299 | // "faillint-v1.3.0", "faillint-v1.4.0", "faillint-v1.5.0", |
| 300 | // "go-bindata-v3.1.1+incompatible", |
| 301 | // "wr_buildable-v0.0.0-20210109165512-ccbd4039b94a", "wr_buildable-v0.0.0-20210110214650-ab990d1be30b", |
| 302 | // }, |
| 303 | // }, |
| 304 | } |
| 305 | |
| 306 | func TestCompatibilityCurrentVersionCreatescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/TestCompatibilityCurrentVersionCreate().(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 307 | currTestCaseDir := fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.9 fmt/Sprintf().("testdata/testproject_with_bingo_%s", stringsscip-go gomod github.com/golang/go/src go1.24.9 strings/.ReplaceAllscip-go gomod github.com/golang/go/src go1.24.9 strings/ReplaceAll().(versionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo/pkg/version`/.Versionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo/pkg/version`/Version., ".", "_")) |
| 308 | |
| 309 | g := newIsolatedGoEnvscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/newIsolatedGoEnv().(t, defaultGoProxyscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/defaultGoProxy.) |
| 310 | defer g.Closescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#Close().(t) |
| 311 | |
| 312 | // We manually build bingo binary to make sure GOCACHE will not hit us. |
| 313 | bingoPath := filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., bingoBinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/bingoBin.) |
| 314 | buildInitialGobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/buildInitialGobin().(t, bingoPath) |
| 315 | |
| 316 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Okscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Ok().(t, osscip-go gomod github.com/golang/go/src go1.24.9 os/.MkdirAllscip-go gomod github.com/golang/go/src go1.24.9 os/MkdirAll().(filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., "newproject"), osscip-go gomod github.com/golang/go/src go1.24.9 os/.ModePermscip-go gomod github.com/golang/go/src go1.24.9 os/ModePerm.)) |
| 317 | p := newTestProjectscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/newTestProject().(t, filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., "newproject"), filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., "testproject"), false) |
| 318 | p.assertNotChangedscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#assertNotChanged().(t) |
| 319 | |
| 320 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "github.com/bwplotka/bingo-testmodule/buildable@39a7f0ae0b1e1e67a75033fc671ccc2c5b3bbddf,v1.0.0,v1.1.0")) |
| 321 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "github.com/bwplotka/bingo-testmodule/buildable2@9d83f47b84c5d9262ecaf649bfa01f0f1cb6ebd2")) |
| 322 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "-n", "buildable-v2", "github.com/bwplotka/bingo-testmodule/v2/[email protected]")) |
| 323 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "-n", "buildable-withReplace", "github.com/bwplotka/bingo-testmodule/buildable@fe4d42a37d927cbf6d2c0f30fe1459d493146664")) |
| 324 | |
| 325 | expectBingoListRowsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/expectBingoListRows().(t, bingoExpectedCompatibilityRowsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/bingoExpectedCompatibilityRows., g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "list")) |
| 326 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, bingoExpectedCompatibilityBinariesscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/bingoExpectedCompatibilityBinaries., g.existingBinariesscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#existingBinaries().(t)) |
| 327 | |
| 328 | // Generate current version test case for further tests. This should be committed as well if changed. |
| 329 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Okscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Ok().(t, osscip-go gomod github.com/golang/go/src go1.24.9 os/.RemoveAllscip-go gomod github.com/golang/go/src go1.24.9 os/RemoveAll().(currTestCaseDir)) |
| 330 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Okscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Ok().(t, osscip-go gomod github.com/golang/go/src go1.24.9 os/.MkdirAllscip-go gomod github.com/golang/go/src go1.24.9 os/MkdirAll().(filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(currTestCaseDir, ".bingo"), osscip-go gomod github.com/golang/go/src go1.24.9 os/.ModePermscip-go gomod github.com/golang/go/src go1.24.9 os/ModePerm.)) |
| 331 | _, err := execCmdscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/execCmd().("", nil, "cp", "-r", filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., ".bingo"), currTestCaseDir) |
| 332 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Okscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Ok().(t, err) |
| 333 | } |
| 334 | |
| 335 | var ( |
| 336 | bingoExpectedCompatibilityRowsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/bingoExpectedCompatibilityRows. = []rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#{ |
| 337 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-v0.0.0-20221007091146-39a7f0ae0b1e", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 338 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-v1.0.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 339 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-v1.1.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 340 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable-v2", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-v2-v2.0.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/v2/[email protected]"}, |
| 341 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable-withReplace", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable-withReplace-v0.0.0-20221007091003-fe4d42a37d92", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 342 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "buildable2", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "buildable2-v0.0.0-20221007091238-9d83f47b84c5", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/bingo-testmodule/[email protected]"}, |
| 343 | } |
| 344 | bingoExpectedCompatibilityBinariesscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/bingoExpectedCompatibilityBinaries. = []string{ |
| 345 | "buildable-v0.0.0-20221007091146-39a7f0ae0b1e", "buildable-v1.0.0", "buildable-v1.1.0", "buildable-v2-v2.0.0", "buildable-withReplace-v0.0.0-20221007091003-fe4d42a37d92", "buildable2-v0.0.0-20221007091238-9d83f47b84c5", |
| 346 | } |
| 347 | ) |
| 348 | |
| 349 | func TestCompatibilityscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/TestCompatibility().(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 350 | t.Parallelscip-go gomod github.com/golang/go/src go1.24.9 testing/T#Parallel().() |
| 351 | |
| 352 | dirs, err := filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Globscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Glob().("testdata/testproject*") |
| 353 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Okscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Ok().(t, err) |
| 354 | |
| 355 | g := newIsolatedGoEnvscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/newIsolatedGoEnv().(t, defaultGoProxyscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/defaultGoProxy.) |
| 356 | defer g.Closescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#Close().(t) |
| 357 | |
| 358 | var goVersion *semverscip-go gomod github.com/Masterminds/semver v1.5.0 `github.com/Masterminds/semver`/.Versionscip-go gomod github.com/Masterminds/semver v1.5.0 `github.com/Masterminds/semver`/Version# |
| 359 | { |
| 360 | r, err := runnerscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo/pkg/runner`/.NewRunnerscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo/pkg/runner`/NewRunner().(contextscip-go gomod github.com/golang/go/src go1.24.9 context/.Backgroundscip-go gomod github.com/golang/go/src go1.24.9 context/Background().(), nil, false, "go") |
| 361 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Okscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Ok().(t, err) |
| 362 | goVersion = r.GoVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo/pkg/runner`/Runner#GoVersion().() |
| 363 | } |
| 364 | |
| 365 | for _, dir := range dirs { |
| 366 | t.Runscip-go gomod github.com/golang/go/src go1.24.9 testing/T#Run().(dir, func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 367 | for _, isGoProject := range []bool{false, true} { |
| 368 | t.Runscip-go gomod github.com/golang/go/src go1.24.9 testing/T#Run().(fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.9 fmt/Sprintf().("isGoProject=%v", isGoProject), func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 369 | t.Runscip-go gomod github.com/golang/go/src go1.24.9 testing/T#Run().("Via bingo get all", func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 370 | g.Clearscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#Clear().(t) |
| 371 | |
| 372 | // Copy testproject at the beginning to temp dir. |
| 373 | p := newTestProjectscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/newTestProject().(t, dir, filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., "testproject1"), isGoProject) |
| 374 | p.assertNotChangedscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#assertNotChanged().(t, defaultModDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/defaultModDir.) |
| 375 | |
| 376 | // We manually build bingo binary to make sure GOCACHE will not hit us. |
| 377 | bingoPath := filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., bingoBinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/bingoBin.) |
| 378 | buildInitialGobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/buildInitialGobin().(t, bingoPath) |
| 379 | |
| 380 | expectBingoListRowsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/expectBingoListRows().(t, bingoExpectedCompatibilityRowsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/bingoExpectedCompatibilityRows., g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "list")) |
| 381 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, []string{}, g.existingBinariesscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#existingBinaries().(t)) |
| 382 | |
| 383 | defer p.assertNotChangedscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#assertNotChanged().(t, defaultModDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/defaultModDir.) |
| 384 | |
| 385 | // Get all binaries by doing 'bingo get'. |
| 386 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get")) |
| 387 | expectBingoListRowsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/expectBingoListRows().(t, bingoExpectedCompatibilityRowsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/bingoExpectedCompatibilityRows., g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "list")) |
| 388 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, bingoExpectedCompatibilityBinariesscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/bingoExpectedCompatibilityBinaries., g.existingBinariesscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#existingBinaries().(t)) |
| 389 | |
| 390 | // Expect binaries works: |
| 391 | // TODO(bwplotka) Check all. |
| 392 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, "buildable\n", g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.gobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#gobin., "buildable-v1.0.0"))) |
| 393 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, "buildable\n", g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.gobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#gobin., "buildable-withReplace-v0.0.0-20221007091003-fe4d42a37d92"))) |
| 394 | }) |
| 395 | t.Runscip-go gomod github.com/golang/go/src go1.24.9 testing/T#Run().("Via go", func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 396 | g.Clearscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#Clear().(t) |
| 397 | |
| 398 | // Copy testproject at the beginning to temp dir. |
| 399 | // NOTE: No bingo binary is required here. |
| 400 | p := newTestProjectscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/newTestProject().(t, dir, filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., "testproject2"), isGoProject) |
| 401 | p.assertNotChangedscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#assertNotChanged().(t, defaultModDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/defaultModDir.) |
| 402 | |
| 403 | // We manually build bingo binary to make sure GOCACHE will not hit us. |
| 404 | bingoPath := filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., bingoBinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/bingoBin.) |
| 405 | buildInitialGobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/buildInitialGobin().(t, bingoPath) |
| 406 | |
| 407 | expectBingoListRowsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/expectBingoListRows().(t, bingoExpectedCompatibilityRowsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/bingoExpectedCompatibilityRows., g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "list")) |
| 408 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, []string{}, g.existingBinariesscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#existingBinaries().(t)) |
| 409 | |
| 410 | defer p.assertNotChangedscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#assertNotChanged().(t, defaultModDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/defaultModDir.) |
| 411 | |
| 412 | if isGoProject { |
| 413 | // This should work without cd even. |
| 414 | _, err := execCmdscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/execCmd().(p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., nil, "go", "build", "-mod=mod", "-modfile="+filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(defaultModDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/defaultModDir., "buildable.1.mod"), |
| 415 | "-o="+filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.gobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#gobin., "buildable-v1.0.0"), "github.com/bwplotka/bingo-testmodule/buildable") |
| 416 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Okscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Ok().(t, err) |
| 417 | _, err = execCmdscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/execCmd().(p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., nil, "go", "build", "-mod=mod", "-modfile="+filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(defaultModDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/defaultModDir., "buildable-withReplace.mod"), |
| 418 | "-o="+filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.gobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#gobin., "buildable-withReplace-v0.0.0-20221007091003-fe4d42a37d92"), "github.com/bwplotka/bingo-testmodule/buildable") |
| 419 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Okscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Ok().(t, err) |
| 420 | } else { |
| 421 | // For no go projects we have this "bug" that requires go.mod to be present. |
| 422 | _, err := execCmdscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/execCmd().(filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., defaultModDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/defaultModDir.), nil, "go", "build", "-mod=mod", "-modfile=buildable.1.mod", |
| 423 | "-o="+filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.gobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#gobin., "buildable-v1.0.0"), "github.com/bwplotka/bingo-testmodule/buildable") |
| 424 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Okscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Ok().(t, err) |
| 425 | _, err = execCmdscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/execCmd().(filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., defaultModDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/defaultModDir.), nil, "go", "build", "-mod=mod", "-modfile=buildable-withReplace.mod", |
| 426 | "-o="+filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.gobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#gobin., "buildable-withReplace-v0.0.0-20221007091003-fe4d42a37d92"), "github.com/bwplotka/bingo-testmodule/buildable") |
| 427 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Okscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Ok().(t, err) |
| 428 | |
| 429 | } |
| 430 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, "buildable\n", g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.gobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#gobin., "buildable-v1.0.0"))) |
| 431 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, "buildable\n", g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.gobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#gobin., "buildable-withReplace-v0.0.0-20221007091003-fe4d42a37d92"))) |
| 432 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, []string{"buildable-v1.0.0", "buildable-withReplace-v0.0.0-20221007091003-fe4d42a37d92"}, g.existingBinariesscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#existingBinaries().(t)) |
| 433 | }) |
| 434 | // TODO(bwplotka): Test variables.env as well. |
| 435 | t.Runscip-go gomod github.com/golang/go/src go1.24.9 testing/T#Run().("Makefile", func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 436 | if !goVersion.LessThanscip-go gomod github.com/Masterminds/semver v1.5.0 `github.com/Masterminds/semver`/Version#LessThan().(versionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo/pkg/version`/.Go116scip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo/pkg/version`/Go116.) { |
| 437 | // These projects are configured with modules but the generated Makefiles do not contain the |
| 438 | // `-mod=mod` argument, and that makes those Makefiles incompatible with Go modules in 1.16. |
| 439 | // Let's run bingo get to simulate |
| 440 | for _, v := range []string{"v0_1_1", "v0_2_0", "v0_2_1", "v0_2_2"} { |
| 441 | if stringsscip-go gomod github.com/golang/go/src go1.24.9 strings/.HasSuffixscip-go gomod github.com/golang/go/src go1.24.9 strings/HasSuffix().(dir, v) { |
| 442 | t.Skipfscip-go gomod github.com/golang/go/src go1.24.9 testing/common#Skipf().("skipping %q in Go >= 1.16 because the generated Makefile is missing the '-mod-mod' flag and it is needed in Go >= 1.16", dir) |
| 443 | } |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | // Make is one of test requirement. |
| 448 | makePath := makePathscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/makePath().(t) |
| 449 | |
| 450 | g.Clearscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#Clear().(t) |
| 451 | |
| 452 | // Copy testproject at the beginning to temp dir. |
| 453 | prjRoot := filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., "testproject") |
| 454 | p := newTestProjectscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/newTestProject().(t, dir, prjRoot, isGoProject) |
| 455 | p.assertNotChangedscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#assertNotChanged().(t, defaultModDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/defaultModDir.) |
| 456 | |
| 457 | // We manually build bingo binary to make sure GOCACHE will not hit us. |
| 458 | bingoPath := filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., bingoBinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/bingoBin.) |
| 459 | buildInitialGobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/buildInitialGobin().(t, bingoPath) |
| 460 | |
| 461 | expectBingoListRowsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/expectBingoListRows().(t, bingoExpectedCompatibilityRowsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/bingoExpectedCompatibilityRows., g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "list")) |
| 462 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, []string{}, g.existingBinariesscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#existingBinaries().(t)) |
| 463 | |
| 464 | g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., makePath, "buildable-v2-exists") |
| 465 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, []string{"buildable-v2-v2.0.0"}, g.existingBinariesscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#existingBinaries().(t)) |
| 466 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, "buildable\n", g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.gobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#gobin., "buildable-v2-v2.0.0"))) |
| 467 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.NotOkscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/NotOk().(t, g.ExpectErrscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExpectErr().(p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.gobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#gobin., "buildable-withReplace-v0.0.0-20221007091003-fe4d42a37d92"))) |
| 468 | |
| 469 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, "(re)installing "+g.gobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#gobin.+"/buildable-withReplace-v0.0.0-20221007091003-fe4d42a37d92\nchecking buildable-with-replace\n", g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., makePath, "buildable-withreplace-exists")) |
| 470 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, "checking buildable-v2\n", g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., makePath, "buildable-v2-exists")) |
| 471 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, []string{"buildable-v2-v2.0.0", "buildable-withReplace-v0.0.0-20221007091003-fe4d42a37d92"}, g.existingBinariesscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#existingBinaries().(t)) |
| 472 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, "buildable\n", g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.gobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#gobin., "buildable-v2-v2.0.0"))) |
| 473 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, "buildable\n", g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.gobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#gobin., "buildable-withReplace-v0.0.0-20221007091003-fe4d42a37d92"))) |
| 474 | |
| 475 | t.Runscip-go gomod github.com/golang/go/src go1.24.9 testing/T#Run().("Delete binary file, expect reinstall", func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 476 | _, err := execCmdscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/execCmd().(g.gobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#gobin., nil, "rm", "buildable-v2-v2.0.0") |
| 477 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Okscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Ok().(t, err) |
| 478 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, []string{"buildable-withReplace-v0.0.0-20221007091003-fe4d42a37d92"}, g.existingBinariesscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#existingBinaries().(t)) |
| 479 | |
| 480 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, "(re)installing "+g.gobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#gobin.+"/buildable-v2-v2.0.0\nchecking buildable-v2\n", g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., makePath, "buildable-v2-exists")) |
| 481 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, "checking buildable-with-replace\n", g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., makePath, "buildable-withreplace-exists")) |
| 482 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, []string{"buildable-v2-v2.0.0", "buildable-withReplace-v0.0.0-20221007091003-fe4d42a37d92"}, g.existingBinariesscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#existingBinaries().(t)) |
| 483 | }) |
| 484 | }) |
| 485 | }) |
| 486 | } |
| 487 | }) |
| 488 | } |
| 489 | } |
| 490 | |
| 491 | func TestGet_ModuleCasesscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/TestGet_ModuleCases().(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 492 | g := newIsolatedGoEnvscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/newIsolatedGoEnv().(t, defaultGoProxyscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/defaultGoProxy.) |
| 493 | defer g.Closescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#Close().(t) |
| 494 | |
| 495 | var goVersion *semverscip-go gomod github.com/Masterminds/semver v1.5.0 `github.com/Masterminds/semver`/.Versionscip-go gomod github.com/Masterminds/semver v1.5.0 `github.com/Masterminds/semver`/Version# |
| 496 | { |
| 497 | r, err := runnerscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo/pkg/runner`/.NewRunnerscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo/pkg/runner`/NewRunner().(contextscip-go gomod github.com/golang/go/src go1.24.9 context/.Backgroundscip-go gomod github.com/golang/go/src go1.24.9 context/Background().(), nil, false, "go") |
| 498 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Okscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Ok().(t, err) |
| 499 | goVersion = r.GoVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo/pkg/runner`/Runner#GoVersion().() |
| 500 | } |
| 501 | |
| 502 | t.Runscip-go gomod github.com/golang/go/src go1.24.9 testing/T#Run().("benchstat: latest in case where no major version is found", func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 503 | g.Clearscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#Clear().(t) |
| 504 | |
| 505 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Okscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Ok().(t, osscip-go gomod github.com/golang/go/src go1.24.9 os/.MkdirAllscip-go gomod github.com/golang/go/src go1.24.9 os/MkdirAll().(filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., "newproject"), osscip-go gomod github.com/golang/go/src go1.24.9 os/.ModePermscip-go gomod github.com/golang/go/src go1.24.9 os/ModePerm.)) |
| 506 | p := newTestProjectscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/newTestProject().(t, filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., "newproject"), filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., "testproject"), false) |
| 507 | p.assertNotChangedscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#assertNotChanged().(t) |
| 508 | |
| 509 | // We manually build bingo binary to make sure GOCACHE will not hit us. |
| 510 | bingoPath := filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., bingoBinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/bingoBin.) |
| 511 | buildInitialGobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/buildInitialGobin().(t, bingoPath) |
| 512 | |
| 513 | expectBingoListRowsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/expectBingoListRows().(t, []rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#(nil), g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "list")) |
| 514 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, []string{}, g.existingBinariesscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#existingBinaries().(t)) |
| 515 | |
| 516 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "golang.org/x/perf/cmd/benchstat@latest")) |
| 517 | }) |
| 518 | |
| 519 | t.Runscip-go gomod github.com/golang/go/src go1.24.9 testing/T#Run().("module with generics", func(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 520 | g.Clearscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#Clear().(t) |
| 521 | |
| 522 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Okscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Ok().(t, osscip-go gomod github.com/golang/go/src go1.24.9 os/.MkdirAllscip-go gomod github.com/golang/go/src go1.24.9 os/MkdirAll().(filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., "newproject"), osscip-go gomod github.com/golang/go/src go1.24.9 os/.ModePermscip-go gomod github.com/golang/go/src go1.24.9 os/ModePerm.)) |
| 523 | p := newTestProjectscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/newTestProject().(t, filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., "newproject"), filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., "testproject"), false) |
| 524 | p.assertNotChangedscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#assertNotChanged().(t) |
| 525 | |
| 526 | // We manually build bingo binary to make sure GOCACHE will not hit us. |
| 527 | bingoPath := filepathscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.24.9 `path/filepath`/Join().(g.tmpDirscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#tmpDir., bingoBinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/bingoBin.) |
| 528 | buildInitialGobinscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/buildInitialGobin().(t, bingoPath) |
| 529 | |
| 530 | expectBingoListRowsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/expectBingoListRows().(t, []rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#(nil), g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "list")) |
| 531 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, []string{}, g.existingBinariesscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#existingBinaries().(t)) |
| 532 | |
| 533 | if goVersion.LessThanscip-go gomod github.com/Masterminds/semver v1.5.0 `github.com/Masterminds/semver`/Version#LessThan().(semverscip-go gomod github.com/Masterminds/semver v1.5.0 `github.com/Masterminds/semver`/.MustParsescip-go gomod github.com/Masterminds/semver v1.5.0 `github.com/Masterminds/semver`/MustParse().("v1.18")) { |
| 534 | err := g.ExpectErrscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExpectErr().(p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "github.com/bwplotka/bingo-testmodule/buildable2@d48721795572f7b824f60a5b0623e524b263ed0c") |
| 535 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.NotOkscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/NotOk().(t, err) |
| 536 | } else { |
| 537 | fmtscip-go gomod github.com/golang/go/src go1.24.9 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24.9 fmt/Println().(g.ExecOutputscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/goEnv#ExecOutput().(t, p.rootscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/testProject#root., bingoPath, "get", "github.com/bwplotka/bingo-testmodule/buildable2@d48721795572f7b824f60a5b0623e524b263ed0c")) |
| 538 | } |
| 539 | }) |
| 540 | |
| 541 | // Tricky cases TODO. |
| 542 | |
| 543 | // Regression against https://github.com/bwplotka/bingo/issues/125 |
| 544 | //t.Run("golangcilint", func(t *testing.T) { |
| 545 | // g.Clear(t) |
| 546 | // |
| 547 | // testutil.Ok(t, os.MkdirAll(filepath.Join(g.tmpDir, "newproject"), os.ModePerm)) |
| 548 | // p := newTestProject(t, filepath.Join(g.tmpDir, "newproject"), filepath.Join(g.tmpDir, "testproject"), true) |
| 549 | // p.assertNotChanged(t) |
| 550 | // |
| 551 | // // We manually build bingo binary to make sure GOCACHE will not hit us. |
| 552 | // bingoPath := filepath.Join(g.tmpDir, bingoBin) |
| 553 | // buildInitialGobin(t, bingoPath) |
| 554 | // |
| 555 | // expectBingoListRows(t, []row(nil), g.ExecOutput(t, p.root, bingoPath, "list")) |
| 556 | // testutil.Equals(t, []string{}, g.existingBinaries(t)) |
| 557 | // |
| 558 | // fmt.Println(g.ExecOutput(t, p.root, bingoPath, "get", "github.com/golangci/golangci-lint/cmd/[email protected]")) |
| 559 | //}) |
| 560 | |
| 561 | // // Regression test against https://github.com/bwplotka/bingo/issues/65. |
| 562 | // name: "get tool with capital letters in name", |
| 563 | // do: func(t *testing.T, g *goEnv, p *testProject) { |
| 564 | // Println(g.ExecOutput(t, p.root, bingoPath, "get", "github.com/githubnemo/CompileDaemon@87e39427f4ba26da4400abf3b26b2e58bfc9ebe6")) |
| 565 | |
| 566 | // name: "Get tricky case with replace (thanos)", |
| 567 | // do: func(t *testing.T, g *goEnv, p *testProject) { |
| 568 | // // For Thanos/Prom/k8s etc without replace even go-get or list fails. This should be handled well. |
| 569 | |
| 570 | // Exclude fields. |
| 571 | |
| 572 | // { |
| 573 | // name: "Get tricky case with retract (ginkgo)", |
| 574 | // do: func(t *testing.T, g *goEnv, p *testProject) { |
| 575 | // if goVersion.LessThan(version.Go116) { |
| 576 | // t.Skip("Go version below 1.16 are not understanding go modules with retract directive; skip it.") |
| 577 | // fmt.Println(g.ExecOutput(t, p.root, bingoPath, "get", "github.com/onsi/ginkgo/[email protected]")) |
| 578 | // } |
| 579 | |
| 580 | // // TODO(bwplotka): Uncomment when https://github.com/githubnemo/CompileDaemon/pull/76 is merged or |
| 581 | // // https://github.com/bwplotka/bingo/issues/31 |
| 582 | // //{ |
| 583 | // // // Regression test against https://github.com/bwplotka/bingo/issues/65. |
| 584 | // // name: "get tool with capital letters in name (pre modules)", |
| 585 | // fmt.Println(g.ExecOutput(t, p.root, bingoPath, "get", "github.com/githubnemo/[email protected]")) |
| 586 | |
| 587 | // name: "get istio.io/tools/cmd/cue-gen@355a0b7a6ba743d14e3a43a3069287086207f35c (short module base path)", |
| 588 | // do: func(t *testing.T) { |
| 589 | // fmt.Println(g.ExecOutput(t, p.root, bingoPath, "get", "istio.io/tools/cmd/cue-gen@355a0b7a6ba743d14e3a43a3069287086207f35c")) |
| 590 | // }, |
| 591 | } |
| 592 | |
| 593 | type rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row# struct { |
| 594 | namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name., binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName., pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion., buildEnvVarsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#buildEnvVars., buildFlagsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#buildFlags. string |
| 595 | } |
| 596 | |
| 597 | func removeTabDupsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/removeTabDups().(s string) string { |
| 598 | var b stringsscip-go gomod github.com/golang/go/src go1.24.9 strings/.Builderscip-go gomod github.com/golang/go/src go1.24.9 strings/Builder# |
| 599 | b.Growscip-go gomod github.com/golang/go/src go1.24.9 strings/Builder#Grow().(len(s)) |
| 600 | var last rune |
| 601 | for i, r := range s { |
| 602 | if r != last || r != '\t' || i == 0 { |
| 603 | b.WriteRunescip-go gomod github.com/golang/go/src go1.24.9 strings/Builder#WriteRune().(r) |
| 604 | last = r |
| 605 | } |
| 606 | } |
| 607 | return b.Stringscip-go gomod github.com/golang/go/src go1.24.9 strings/Builder#String().() |
| 608 | } |
| 609 | |
| 610 | func expectBingoListRowsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/expectBingoListRows().(t testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.TBscip-go gomod github.com/golang/go/src go1.24.9 testing/TB#, expect []rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#, output string) { |
| 611 | t.Helperscip-go gomod github.com/golang/go/src go1.24.9 testing/TB#Helper().() |
| 612 | |
| 613 | var ( |
| 614 | trimmed = stringsscip-go gomod github.com/golang/go/src go1.24.9 strings/.TrimPrefixscip-go gomod github.com/golang/go/src go1.24.9 strings/TrimPrefix().(removeTabDupsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/removeTabDups().(output), bingoscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo/pkg/bingo`/.PackageRenderablesPrintHeaderscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo/pkg/bingo`/PackageRenderablesPrintHeader.) |
| 615 | got []rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row# |
| 616 | ) |
| 617 | for _, line := range stringsscip-go gomod github.com/golang/go/src go1.24.9 strings/.Splitscip-go gomod github.com/golang/go/src go1.24.9 strings/Split().(trimmed, "\n") { |
| 618 | s := stringsscip-go gomod github.com/golang/go/src go1.24.9 strings/.Fieldsscip-go gomod github.com/golang/go/src go1.24.9 strings/Fields().(line) |
| 619 | if len(s) == 0 { |
| 620 | break |
| 621 | } |
| 622 | r := rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#{namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: s[0]} |
| 623 | if len(s) > 1 { |
| 624 | r.binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName. = s[1] |
| 625 | } |
| 626 | if len(s) > 2 { |
| 627 | r.pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion. = s[2] |
| 628 | } |
| 629 | if len(s) > 3 { |
| 630 | r.buildEnvVarsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#buildEnvVars. = s[3] |
| 631 | } |
| 632 | if len(s) > 4 { |
| 633 | r.buildFlagsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#buildFlags. = s[4] |
| 634 | } |
| 635 | got = append(got, r) |
| 636 | } |
| 637 | testutilscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/.Equalsscip-go gomod github.com/efficientgo/core v1.0.0-rc.3 `github.com/efficientgo/core/testutil`/Equals().(t, expect, got) |
| 638 | } |
| 639 | |
| 640 | func TestExpectBingoListRowsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/TestExpectBingoListRows().(t *testingscip-go gomod github.com/golang/go/src go1.24.9 testing/.Tscip-go gomod github.com/golang/go/src go1.24.9 testing/T#) { |
| 641 | expectBingoListRowsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/expectBingoListRows().(t, []rowscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#{ |
| 642 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "copyright", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "copyright-v0.0.0-20210112004814-138d5e5695fe", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/efficientgo/tools/[email protected]"}, |
| 643 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "embedmd", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "embedmd-v1.0.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/campoy/[email protected]", buildEnvVarsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#buildEnvVars.: "CGO_ENABLED=1", buildFlagsscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#buildFlags.: "-tags=lol"}, |
| 644 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "faillint", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "faillint-v1.5.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/fatih/[email protected]"}, |
| 645 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "goimports", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "goimports-v0.0.0-20210112230658-8b4aab62c064", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "golang.org/x/tools/cmd/[email protected]"}, |
| 646 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "golangci-lint", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "golangci-lint-v1.26.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/golangci/golangci-lint/cmd/[email protected]"}, |
| 647 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "mdox", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "mdox-v0.2.1", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/bwplotka/[email protected]"}, |
| 648 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "misspell", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "misspell-v0.3.4", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/client9/misspell/cmd/[email protected]"}, |
| 649 | {namescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#name.: "proxy", binNamescip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#binName.: "proxy-v0.10.0", pkgVersionscip-go gomod github.com/bwplotka/bingo . `github.com/bwplotka/bingo_test`/row#pkgVersion.: "github.com/gomods/athens/cmd/[email protected]"}, |
| 650 | }, `Name Binary Name Package @ Version Build EnvVars Build Flags |
| 651 | ---- ----------- ----------------- ------------- ----------- |
| 652 | copyright copyright-v0.0.0-20210112004814-138d5e5695fe github.com/efficientgo/tools/[email protected] |
| 653 | embedmd embedmd-v1.0.0 github.com/campoy/[email protected] CGO_ENABLED=1 -tags=lol |
| 654 | faillint faillint-v1.5.0 github.com/fatih/[email protected] |
| 655 | goimports goimports-v0.0.0-20210112230658-8b4aab62c064 golang.org/x/tools/cmd/[email protected] |
| 656 | golangci-lint golangci-lint-v1.26.0 github.com/golangci/golangci-lint/cmd/[email protected] |
| 657 | mdox mdox-v0.2.1 github.com/bwplotka/[email protected] |
| 658 | misspell misspell-v0.3.4 github.com/client9/misspell/cmd/[email protected] |
| 659 | proxy proxy-v0.10.0 github.com/gomods/athens/cmd/[email protected] |
| 660 | `) |
| 661 | } |