-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added LICENSE file - Added more test coverage - Fixed failing tests - Various other improvements - Added Go Report Badge
- Loading branch information
Phillip Miller
committed
Oct 20, 2021
1 parent
532a4de
commit 7e0effe
Showing
19 changed files
with
1,210 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ package extra | |
|
||
import ( | ||
"pimp-my-shell/localio" | ||
"runtime" | ||
"testing" | ||
) | ||
|
||
|
@@ -10,6 +11,19 @@ func TestInstallExtraPackages(t *testing.T) { | |
if err != nil { | ||
t.Errorf("failed to create Directories type: %v", err) | ||
} | ||
osType := runtime.GOOS | ||
switch osType { | ||
case "linux": | ||
if err = localio.DownloadAndInstallLatestVersionOfGolang(dirs.HomeDir); err != nil { | ||
t.Errorf("couldn't download and install golang: %v", err) | ||
} | ||
if err = localio.RunCommandPipeOutput("go version"); err != nil { | ||
t.Errorf("couldn't get go version: %v", err) | ||
} | ||
default: | ||
//DoNothing | ||
} | ||
|
||
type args struct { | ||
osType string | ||
dirs *localio.Directories | ||
|
@@ -26,14 +40,38 @@ func TestInstallExtraPackages(t *testing.T) { | |
packages: &localio.InstalledPackages{ | ||
AptInstalledPackages: nil, | ||
BrewInstalledPackages: &localio.BrewInstalled{ | ||
Names: []string{"bat", "lsd", "gnu-sed", "gotop", "yamllint", "git-delta"}, CaskFullNames: []string{"bat"}, Taps: []string{"homebrew/core", "cjbassi/gotop"}, | ||
Names: []string{"bat", "lsd", "gnu-sed", "gotop", "yamllint", "git-delta"}, CaskFullNames: []string{"gotop"}, Taps: []string{"homebrew/core", "cjbassi/gotop"}, | ||
}, | ||
}}, false}, | ||
{"Test InstallExtraPackages darwin lots of packages already installed 2", args{ | ||
osType: "darwin", | ||
dirs: dirs, | ||
packages: &localio.InstalledPackages{ | ||
AptInstalledPackages: nil, | ||
BrewInstalledPackages: &localio.BrewInstalled{ | ||
Names: []string{"aom", "apr", "apr-util", "argon2", "aspell", "assimp", "autoconf", "bdw-gc", "binwalk", "boost", "brotli", "c-ares", "ca-certificates", | ||
"cairo", "cheat", "cmake", "cointop", "coreutils", "cscope", "curl", "dbus", "deployer", "docbook", "docbook-xsl", "double-conversion", "exiftool", | ||
"fontconfig", "freetds", "freetype", "fribidi", "gcc", "gd", "gdbm", "gdk-pixbuf", "gettext", "ghostscript", "git-quick-stats", | ||
"github-markdown-toc", "glib", "gmp", "gnu-getopt", "gnu-sed", "gnupg", "gnutls", "gobject-introspection", "graphite2", "graphviz", "gts", "guile", "gulp-cli", | ||
"harfbuzz", "helm", "htop", "hunspell", "icu4c", "ilmbase", "imagemagick", "imath", "iproute2mac", "ipython", "isl", "jansson", "jasper", "jbig2dec", "jemalloc", | ||
"jpeg", "jq", "kind", "krb5", "lastpass-cli", "libarchive", "libassuan", "libb2", "libde265", "libev", "libevent", "libffi", "libgcrypt", "libgpg-error", "libheif", | ||
"libidn", "libidn2", "libimagequant", "libksba", "liblqr", "libmaxminddb", "libmetalink", "libmpc", "libnghttp2", "libomp", "libpng", "libpq", "libproxy", "libpthread-stubs", | ||
"libraqm", "librsvg", "libsmi", "libsodium", "libssh", "libssh2", "libtasn1", "libtiff", "libtool", "libunistring", "libusb", "libuv", "libx11", "libxau", "libxcb", "libxdmcp", | ||
"libxext", "libxrender", "libyaml", "libzip", "little-cms2", "lnav", "lsd", "lua", "lz4", "lzo", "m4", "macvim", "md4c", "mpdecimal", "mpfr", "msodbcsql17", "mssql-tools", "mysql", | ||
"ncurses", "neofetch", "netpbm", "nettle", "nghttp2", "nmap", "node", "npth", "nspr", "nss", "numpy", "oniguruma", "openblas", "openexr", "openjdk", "openjpeg", "openldap", "[email protected]", | ||
"p11-kit", "p7zip", "packer", "pango", "pcre", "pcre2", "php", "[email protected]", "pillow", "pinentry", "pixman", "pkg-config", "poppler", "popt", "protobuf", "putty", "pyenv", "pyenv-virtualenv", | ||
"[email protected]", "[email protected]", "[email protected]", "qt", "qt@5", "readline", "reattach-to-user-namespace", "rsync", "rtmpdump", "ruby", "screenresolution", "shared-mime-info", "shellcheck", "six", | ||
"sqlite", "ssdeep", "swaks", "tcl-tk", "telnet", "terraform", "tidy-html5", "tmux", "tree", "unbound", "unixodbc", "unrar", "unzip", "utf8proc", "watch", "webp", "wget", "x265", "xmlto", | ||
"xorgproto", "xxhash", "xz", "yamllint", "zeromq", "zstd"}, | ||
CaskFullNames: []string{"font-meslo-lg-nerd-font", "wireshark"}, | ||
Taps: []string{"hashicorp/tap", "homebrew/core", "microsoft/mssql-release"}, | ||
}, | ||
}}, false}, | ||
{"Test InstallExtraPackages Linux 2", args{ | ||
{"Test InstallExtraPackages Linux 3", args{ | ||
osType: "linux", | ||
dirs: dirs, | ||
packages: &localio.InstalledPackages{ | ||
AptInstalledPackages: &localio.AptInstalled{Name: []string{"bat", "lsd", "gotop", "delta"}}, | ||
AptInstalledPackages: &localio.AptInstalled{Name: []string{"bat", "lsd", "delta"}}, | ||
BrewInstalledPackages: nil, | ||
}}, false}, | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.