github.com/swaros/contxt/module/taskrun@v0.0.0-20240305083542-3dbd4436ac40/runner_test.go (about)

     1  package taskrun_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/swaros/contxt/module/taskrun"
     7  )
     8  
     9  func TestTargetAsMapUnique(t *testing.T) {
    10  	strMap := []string{"one", "two", "three"}
    11  
    12  	if taskrun.ExistInStrMap("four", strMap) {
    13  		t.Error("four is not exists in map. but got true on check")
    14  	}
    15  
    16  	if !taskrun.ExistInStrMap("two", strMap) {
    17  		t.Error("two is exists in map. but got false on check")
    18  	}
    19  
    20  	if !taskrun.ExistInStrMap("two ", strMap) {
    21  		t.Error("two is exists in map. but got false on check. we checked 'two ' but the space should be Trim")
    22  	}
    23  }