Changed SessionID format.

Pusher libs are validating the sessionID format. So I need to conform
with its format.
This commit is contained in:
claudemiro
2015-05-17 09:25:57 -03:00
parent 7b578c4fb4
commit 485bc01abe
3 changed files with 28 additions and 10 deletions
+20
View File
@@ -0,0 +1,20 @@
// Copyright 2015 Claudemiro Alves Feitosa Neto. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package utils
import (
"fmt"
"regexp"
"testing"
)
func TestGenerateSession(t *testing.T) {
sessionID := GenerateSessionID()
fmt.Println(sessionID)
if matched, _ := regexp.MatchString("^\\d+\\.\\d+$", sessionID); !matched {
t.Errorf("Must match ^\\d+\\.\\d+$, value: '%s'", sessionID)
}
}