diff options
author | Jakob Unterwurzacher | 2016-02-06 22:54:14 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-02-06 22:54:14 +0100 |
commit | e111e20649cfacd7b02dd454d75db879aa2ca53c (patch) | |
tree | 5020d3172bfa2462f05898473093dabd3688e64f /internal/nametransform/longnames_test.go | |
parent | 5abd9cec136bfb981c728eb3bf0f92b2282601c6 (diff) |
longnames part I: Create and OpenDir work with long filenames > 176 bytes
Todo: Rename, Unlink, Rmdir, Mknod, Mkdir
Diffstat (limited to 'internal/nametransform/longnames_test.go')
-rw-r--r-- | internal/nametransform/longnames_test.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/nametransform/longnames_test.go b/internal/nametransform/longnames_test.go new file mode 100644 index 0000000..dc4098c --- /dev/null +++ b/internal/nametransform/longnames_test.go @@ -0,0 +1,22 @@ +package nametransform + +import ( + "testing" +) + +func TestIsLongName(t *testing.T) { + n := "gocryptfs.longname.LkwUdALvV_ANnzQN6ZZMYnxxfARD3IeZWCKnxGJjYmU=.name" + if IsLongName(n) != 2 { + t.Errorf("False negative") + } + + n = "gocryptfs.longname.LkwUdALvV_ANnzQN6ZZMYnxxfARD3IeZWCKnxGJjYmU=" + if IsLongName(n) != 1 { + t.Errorf("False negative") + } + + n = "LkwUdALvV_ANnzQN6ZZMYnxxfARD3IeZWCKnxGJjYmU=" + if IsLongName(n) != 0 { + t.Errorf("False positive") + } +} |