Making short deviceID length consistent and referencing to protocol file for future-proof edits. Closes #9313.
This commit is contained in:
@@ -14,7 +14,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
DeviceIDLength = 32
|
||||
DeviceIDLength = 32
|
||||
// keep consistent with shortIDStringLength in gui/default/syncthing/app.js
|
||||
ShortIDStringLength = 7
|
||||
)
|
||||
|
||||
|
||||
@@ -84,6 +84,7 @@ func TestShortIDString(t *testing.T) {
|
||||
id, _ := DeviceIDFromString(formatted)
|
||||
|
||||
sid := id.Short().String()
|
||||
// keep consistent with ShortIDStringLength in lib/protocol/deviceid.go
|
||||
if len(sid) != 7 {
|
||||
t.Errorf("Wrong length for short ID: got %d, want 7", len(sid))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user