1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-28 23:42:51 -05:00

core: add slices, paths, exec utils

This commit is contained in:
bbedward
2025-12-09 15:28:19 -05:00
parent e307de83e2
commit aeacf109eb
44 changed files with 931 additions and 625 deletions

View File

@@ -7,6 +7,7 @@ import (
"testing"
mocks_version "github.com/AvengeMedia/DankMaterialShell/core/internal/mocks/version"
"github.com/AvengeMedia/DankMaterialShell/core/internal/utils"
)
func TestCompareVersions(t *testing.T) {
@@ -150,7 +151,7 @@ func TestGetCurrentDMSVersion_NotInstalled(t *testing.T) {
}
func TestGetCurrentDMSVersion_GitTag(t *testing.T) {
if !commandExists("git") {
if !utils.CommandExists("git") {
t.Skip("git not available")
}
@@ -183,7 +184,7 @@ func TestGetCurrentDMSVersion_GitTag(t *testing.T) {
}
func TestGetCurrentDMSVersion_GitBranch(t *testing.T) {
if !commandExists("git") {
if !utils.CommandExists("git") {
t.Skip("git not available")
}
@@ -314,11 +315,6 @@ func TestVersionInfo_HasUpdate_Tag(t *testing.T) {
}
}
func commandExists(cmd string) bool {
_, err := exec.LookPath(cmd)
return err == nil
}
func TestGetLatestDMSVersion_FallbackParsing(t *testing.T) {
jsonResponse := `{
"tag_name": "v0.1.17",