2016-02-06 22:54:14 +01:00
|
|
|
package nametransform
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestIsLongName(t *testing.T) {
|
|
|
|
n := "gocryptfs.longname.LkwUdALvV_ANnzQN6ZZMYnxxfARD3IeZWCKnxGJjYmU=.name"
|
2016-04-10 19:32:10 +02:00
|
|
|
if NameType(n) != LongNameFilename {
|
2016-02-06 22:54:14 +01:00
|
|
|
t.Errorf("False negative")
|
|
|
|
}
|
|
|
|
|
|
|
|
n = "gocryptfs.longname.LkwUdALvV_ANnzQN6ZZMYnxxfARD3IeZWCKnxGJjYmU="
|
2016-04-10 19:32:10 +02:00
|
|
|
if NameType(n) != LongNameContent {
|
2016-02-06 22:54:14 +01:00
|
|
|
t.Errorf("False negative")
|
|
|
|
}
|
|
|
|
|
|
|
|
n = "LkwUdALvV_ANnzQN6ZZMYnxxfARD3IeZWCKnxGJjYmU="
|
2016-04-10 19:32:10 +02:00
|
|
|
if NameType(n) != LongNameNone {
|
2016-02-06 22:54:14 +01:00
|
|
|
t.Errorf("False positive")
|
|
|
|
}
|
|
|
|
}
|