initial
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user