MCPcopy Create free account
hub / github.com/dwin/goSecretBoxPassword / TestGetHashVersion

Function TestGetHashVersion

password_test.go:96–110  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

94
95}
96func TestGetHashVersion(t *testing.T) {
97 v, err := GetHashVersion("secBoxv1$0$tKTBCfdTcn5gA9xRR9yPNczryWV/f+7MVkdDgxFtuYuzvTcNGMNTHBE2pCoPjRjTDIN1449gwVHfrkzvkzWdwZBEUCVWVZFjlRTdu8kCD7uBDmfozwyX+U/T7k8cyfaHFgB8y8cPEvk=$Ek8NWSL34KE=$32768$16$1$16384$8$1")
98 if err != nil {
99 t.Log(err)
100 t.FailNow()
101 }
102 fmt.Println("Hash Version: ", v)
103
104 // Test with Bad Version; secBoxvb instead of expected secBoxv1
105 _, err = GetHashVersion("secBoxvb$0$tKTBCfdTcn5gA9xRR9yPNczryWV/f+7MVkdDgxFtuYuzvTcNGMNTHBE2pCoPjRjTDIN1449gwVHfrkzvkzWdwZBEUCVWVZFjlRTdu8kCD7uBDmfozwyX+U/T7k8cyfaHFgB8y8cPEvk=$Ek8NWSL34KE=$32768$16$1$16384$8$1")
106 if err == nil {
107 t.Log("Expected int parse from string error")
108 t.FailNow()
109 }
110}
111
112func TestGetMasterVersion(t *testing.T) {
113 v, err := GetMasterVersion("secBoxv1$0$tKTBCfdTcn5gA9xRR9yPNczryWV/f+7MVkdDgxFtuYuzvTcNGMNTHBE2pCoPjRjTDIN1449gwVHfrkzvkzWdwZBEUCVWVZFjlRTdu8kCD7uBDmfozwyX+U/T7k8cyfaHFgB8y8cPEvk=$Ek8NWSL34KE=$32768$16$1$16384$8$1")

Callers

nothing calls this directly

Calls 1

GetHashVersionFunction · 0.85

Tested by

no test coverage detected