1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
diff --git a/spectre_test.go b/spectre_test.go
index d164e0a48b4e076737ed770c6178ac10a0b4ca2a..27deb2ddd0930082c53921851c35b51a36c9e1f9 100644
--- a/spectre_test.go
+++ b/spectre_test.go
@@ -4,7 +4,6 @@ import (
_ "embed"
"encoding/xml"
"strconv"
- "strings"
"testing"
)
@@ -15,16 +14,13 @@ t.Log("could not load test data")
t.FailNow()
}
- scoper := SimpleScope{
- Key: "com.lyndir.masterpassword",
- }
dc := tests.Cases[0]
for _, tc := range tests.Cases[1:] {
t.Run(tc.ID, func(t *testing.T) {
user := def(dc.UserName, tc.UserName)
secret := def(dc.UserSecret, tc.UserSecret)
- s, err := New(user, secret, scoper)
+ s, err := New(user, secret)
if err != nil {
t.Logf("could not initialize spectre: %v", err)
t.Fail()
@@ -46,11 +42,26 @@ WithCounter(counter),
WithScope(Scope(scope)),
)
- if !strings.EqualFold(pass, tc.Result) {
+ if pass != tc.Result {
t.Log("passwords did not match")
t.Fail()
}
})
+ }
+}
+
+// From the website sanity check
+func TestSanity(t *testing.T) {
+ s, err := New("Robert Lee Mitchell", "banana colored duckling")
+ if err != nil {
+ t.Logf("failed sanity check: %v", err)
+ t.FailNow()
+ }
+
+ pw := s.Site("masterpasswordapp.com")
+ if pw != "Jejr5[RepuSosp" {
+ t.Log("failed sanity check")
+ t.FailNow()
}
}
|