Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (24 sloc) 0.499 kb
package main
import (
"testing"
)
func TestServerIDValidation(t *testing.T) {
tests := map[string]bool{
"": false,
"/": false,
"/@thing": false,
"@thing": false,
"/something": false,
"master": true,
"something": true,
}
for testId, shouldBeOK := range tests {
err := validateServerId(testId)
isOK := err == nil
if shouldBeOK != isOK {
t.Errorf("Expected ok=%v for %v, got %v (%v)",
shouldBeOK, testId, isOK, err)
t.Fail()
}
}
}
Jump to Line
Something went wrong with that request. Please try again.