MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / TestFirstArg

Function TestFirstArg

internal/bridge/modules_test.go:564–579  ·  view source on GitHub ↗

=================================================================== Helper function tests ===================================================================

(t *testing.T)

Source from the content-addressed store, hash-verified

562// ===================================================================
563
564func TestFirstArg(t *testing.T) {
565 t.Parallel()
566 if got := firstArg(nil); got != "" {
567 t.Errorf("firstArg(nil) = %q, want empty", got)
568 }
569 if got := firstArg(&implantpb.Request{}); got != "" {
570 t.Errorf("firstArg(empty) = %q, want empty", got)
571 }
572 if got := firstArg(&implantpb.Request{Args: []string{"hello"}}); got != "hello" {
573 t.Errorf("firstArg = %q, want hello", got)
574 }
575 // Falls back to Input when Args is empty.
576 if got := firstArg(&implantpb.Request{Input: "fallback"}); got != "fallback" {
577 t.Errorf("firstArg(input fallback) = %q, want fallback", got)
578 }
579}
580
581func TestSecondArg(t *testing.T) {
582 t.Parallel()

Callers

nothing calls this directly

Calls 1

firstArgFunction · 0.85

Tested by

no test coverage detected