more review comments!

This commit is contained in:
Mark Haines 2017-06-16 15:15:11 +01:00
parent 7fa2005c94
commit c4d34db748
2 changed files with 5 additions and 2 deletions

View file

@ -310,6 +310,7 @@ func (config *Dendrite) check() error {
func absPath(dir string, path Path) string {
if filepath.IsAbs(string(path)) {
// filepath.Join cleans the path so we should clean the absolute paths as well for consistency.
return filepath.Clean(string(path))
}
return filepath.Join(dir, string(path))

View file

@ -74,15 +74,17 @@ func TestReadKey(t *testing.T) {
if err != nil {
t.Error("failed to load private key:", err)
}
wantKeyID := "ed25519:c8NsuQ"
wantKeyID := testKeyID
if wantKeyID != string(keyID) {
t.Errorf("wanted key ID to be %q, got %q", wantKeyID, keyID)
}
}
const testKeyID = "ed25519:c8NsuQ"
const testKey = `
-----BEGIN MATRIX PRIVATE KEY-----
Key-ID: ed25519:c8NsuQ
Key-ID: ` + testKeyID + `
7KRZiZ2sTyRR8uqqUjRwczuwRXXkUMYIUHq4Mc3t4bE=
-----END MATRIX PRIVATE KEY-----
`