github.com/leanovate/gopter@v0.2.9/flag_test.go (about)

     1  package gopter_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/leanovate/gopter"
     7  )
     8  
     9  func TestFlag(t *testing.T) {
    10  	flag := &gopter.Flag{}
    11  	if flag.Get() {
    12  		t.Errorf("Flag should be initially unset: %#v", flag)
    13  	}
    14  	flag.Set()
    15  	if !flag.Get() {
    16  		t.Errorf("Flag should be set: %#v", flag)
    17  	}
    18  	flag.Unset()
    19  	if flag.Get() {
    20  		t.Errorf("Flag should be unset: %#v", flag)
    21  	}
    22  }