package monitor_test import ( "reflect" "testing" "git.eeqj.de/sneak/rtnetmon/internal/monitor" ) func TestPingArgs(t *testing.T) { t.Parallel() tests := []struct { goos string want []string }{ {"linux", []string{"-I", ifaceEth0, "-c1", "-W1", host8888}}, {"darwin", []string{"-b", ifaceEth0, "-c1", "-W1000", host8888}}, } for _, tt := range tests { t.Run(tt.goos, func(t *testing.T) { t.Parallel() got := monitor.PingArgs(tt.goos, ifaceEth0, host8888) if !reflect.DeepEqual(got, tt.want) { t.Errorf("PingArgs(%q) = %v, want %v", tt.goos, got, tt.want) } }) } } func TestLossArgs(t *testing.T) { t.Parallel() tests := []struct { goos string want []string }{ {"linux", []string{ "-q", "-i", "0.05", "-c", "20", "-W1", "-I", ifaceEth0, host8888, }}, {"darwin", []string{ "-q", "-i", "0.05", "-c", "20", "-W1000", "-b", ifaceEth0, host8888, }}, } for _, tt := range tests { t.Run(tt.goos, func(t *testing.T) { t.Parallel() got := monitor.LossArgs(tt.goos, ifaceEth0, host8888, 20) if !reflect.DeepEqual(got, tt.want) { t.Errorf("LossArgs(%q) = %v, want %v", tt.goos, got, tt.want) } }) } }