flounder

A simple gemini site builder
git clone git://git.alexwennerberg.com/flounder
Log | Files | Refs | README | LICENSE

flounder_test.go (434B) - raw


      1 package main
      2 
      3 import "testing"
      4 
      5 func TestIsOKUsername(t *testing.T) {
      6 	for _, u := range []string{"www", "proxy", "%", "", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"} {
      7 		if isOkUsername(u) == nil {
      8 			t.Errorf("Username " + u + " should be considered invalid, but wasn't")
      9 		}
     10 	}
     11 	for _, u := range []string{"-", "alex", "1"} {
     12 		if isOkUsername(u) != nil {
     13 			t.Errorf("Username " + u + " should be considered valid, but wasn't")
     14 		}
     15 	}
     16 }