This commit is contained in:
2026-01-06 10:20:34 -08:00
parent 0e1fc6a88d
commit a8ab26752a
15 changed files with 1806 additions and 929 deletions
+36
View File
@@ -0,0 +1,36 @@
//go:build linux
// +build linux
package cli
import (
"testing"
)
// TestExecute tests that the CLI can be initialized
func TestExecute(t *testing.T) {
// This is a simple compilation test to ensure the CLI package compiles
// We can't easily test the full Execute() function as it starts the UI
// Test that rootCmd is properly initialized
if rootCmd == nil {
t.Fatal("rootCmd is nil")
}
if rootCmd.Use != "rtnetmon" {
t.Errorf("Expected rootCmd.Use to be 'rtnetmon', got '%s'", rootCmd.Use)
}
// Test that default configuration is set
if len(defaultReachabilityHosts) == 0 {
t.Error("defaultReachabilityHosts is empty")
}
if len(defaultPacketLossHosts) == 0 {
t.Error("defaultPacketLossHosts is empty")
}
if len(defaultTCPHosts) == 0 {
t.Error("defaultTCPHosts is empty")
}
}