github.com/bshelton229/agent@v3.5.4+incompatible/bootstrap/bootstrap_test.go (about)

     1  package bootstrap
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  )
     8  
     9  var agentNameTests = []struct {
    10  	agentName string
    11  	expected  string
    12  }{
    13  	{"My Agent", "My-Agent"},
    14  	{":docker: My Agent", "-docker--My-Agent"},
    15  	{"My \"Agent\"", "My--Agent-"},
    16  }
    17  
    18  func TestDirForAgentName(t *testing.T) {
    19  	t.Parallel()
    20  
    21  	for _, test := range agentNameTests {
    22  		assert.Equal(t, test.expected, dirForAgentName(test.agentName))
    23  	}
    24  }