(new): rich message support
(fix): runtime reliability (tests): regression coverage (doc): v1.1 release notes
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package laniakea
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestGenerateTokenUsesRawURLAlphabet(t *testing.T) {
|
||||
token, err := generateToken(32)
|
||||
if err != nil {
|
||||
t.Fatalf("generateToken returned error: %v", err)
|
||||
}
|
||||
if strings.Contains(token, "=") {
|
||||
t.Fatalf("token contains forbidden padding: %q", token)
|
||||
}
|
||||
for _, r := range token {
|
||||
if !strings.ContainsRune("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-", r) {
|
||||
t.Fatalf("token contains a character forbidden by Telegram: %q", r)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user