- Add RestartService tests (pkg/sysutil) - Add decodeRedisValue and normalizeRedisValue tests (cache/l2.go)
29 lines
589 B
Go
29 lines
589 B
Go
package sysutil
|
|
|
|
import (
|
|
"runtime"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestRestartService_NonLinux(t *testing.T) {
|
|
// On non-Linux systems, RestartService should return nil without exiting
|
|
if runtime.GOOS == "linux" {
|
|
t.Skip("Skipping non-Linux test on Linux")
|
|
}
|
|
|
|
err := RestartService()
|
|
require.NoError(t, err)
|
|
}
|
|
|
|
func TestRestartServiceAsync_NonLinux(t *testing.T) {
|
|
// On non-Linux systems, RestartServiceAsync should not panic
|
|
if runtime.GOOS == "linux" {
|
|
t.Skip("Skipping non-Linux test on Linux")
|
|
}
|
|
|
|
// Should not panic
|
|
RestartServiceAsync()
|
|
}
|