summaryrefslogtreecommitdiff
path: root/internal/oauth
diff options
context:
space:
mode:
Diffstat (limited to 'internal/oauth')
-rw-r--r--internal/oauth/oauth_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/internal/oauth/oauth_test.go b/internal/oauth/oauth_test.go
new file mode 100644
index 0000000..2427220
--- /dev/null
+++ b/internal/oauth/oauth_test.go
@@ -0,0 +1,24 @@
+package oauth
+
+import (
+ "net/url"
+ "testing"
+)
+
+func Test_verifiergen(t *testing.T) {
+ verifier, verifierErr := genVerifier()
+ if verifierErr != nil {
+ t.Fatalf("Gen verifier error: %v", verifierErr)
+ }
+
+ // Verifier must be at minimum 43 and at max 128 characters...
+ // However... Our verifier is exactly 43!
+ if len(verifier) != 43 {
+ t.Fatalf("Got verifier length: %d, want a verifier with at least 43 characters", len(verifier))
+ }
+
+ _, unescapeErr := url.QueryUnescape(verifier)
+ if unescapeErr != nil {
+ t.Fatalf("Verifier: %s can not be unescaped", verifier)
+ }
+}