=================================================================== Helper function tests ===================================================================
(t *testing.T)
| 562 | // =================================================================== |
| 563 | |
| 564 | func 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 | |
| 581 | func TestSecondArg(t *testing.T) { |
| 582 | t.Parallel() |
nothing calls this directly
no test coverage detected