MCPcopy Create free account
hub / github.com/cloudflare/cfssl / TestPopFirstArg

Function TestPopFirstArg

cli/cli_test.go:106–123  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

104}
105
106func TestPopFirstArg(t *testing.T) {
107 s, str, err := PopFirstArgument([]string{"a", "b", "c"})
108 if s != "a" {
109 t.Fatal("Did not pop first argument successfully")
110 }
111 if str == nil {
112 t.Fatal("Did not return the rest of argument successfully")
113 }
114 if err != nil {
115 t.Fatal(err)
116 }
117
118 //test invalid argument
119 _, _, err = PopFirstArgument([]string{})
120 if err == nil {
121 t.Fatal("No argument given, should return error")
122 }
123}

Callers

nothing calls this directly

Calls 1

PopFirstArgumentFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…