github.com/wawandco/oxpecker-plugins@v0.1.1/tools/standard/flags_test.go (about)

     1  package standard
     2  
     3  import "testing"
     4  
     5  func Test_ParseFlags_Empty(t *testing.T) {
     6  	c := &Plugin{}
     7  	c.ParseFlags([]string{})
     8  
     9  	if c.output != "" {
    10  		t.Errorf("output should be empty, was `%s`", c.output)
    11  	}
    12  }
    13  
    14  func Test_ParseFlags_Value(t *testing.T) {
    15  	c := &Plugin{}
    16  	c.ParseFlags([]string{"-o", "something"})
    17  
    18  	expected := "something"
    19  	if c.output != expected {
    20  		t.Errorf("output should be `%s`, was `%s`", expected, c.output)
    21  	}
    22  }