db72fcea41
Using dirfd-relative operations allows safe lockless handling of the ".name" files.
23 lines
491 B
Go
23 lines
491 B
Go
package nametransform
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestIsLongName(t *testing.T) {
|
|
n := "gocryptfs.longname.LkwUdALvV_ANnzQN6ZZMYnxxfARD3IeZWCKnxGJjYmU=.name"
|
|
if NameType(n) != LongNameFilename {
|
|
t.Errorf("False negative")
|
|
}
|
|
|
|
n = "gocryptfs.longname.LkwUdALvV_ANnzQN6ZZMYnxxfARD3IeZWCKnxGJjYmU="
|
|
if NameType(n) != LongNameContent {
|
|
t.Errorf("False negative")
|
|
}
|
|
|
|
n = "LkwUdALvV_ANnzQN6ZZMYnxxfARD3IeZWCKnxGJjYmU="
|
|
if NameType(n) != LongNameNone {
|
|
t.Errorf("False positive")
|
|
}
|
|
}
|