github.com/ssube/gitlab-ci-multi-runner@v1.2.1-0.20160607142738-b8d1285632e6/helpers/shorten_token_test.go (about)

     1  package helpers
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestShortenToken(t *testing.T) {
     8  	var tests = []struct {
     9  		in  string
    10  		out string
    11  	}{
    12  		{"short", "short"},
    13  		{"veryverylongtoken", "veryvery"},
    14  	}
    15  
    16  	for _, test := range tests {
    17  		actual := ShortenToken(test.in)
    18  		if actual != test.out {
    19  			t.Error("Expected ", test.out, ", get ", actual)
    20  		}
    21  	}
    22  }