Rename Directory to Folder to make more sense.

Introduce new file type TypeFolder which is not used anywhere, however.
This commit is contained in:
Kleissner
2021-08-27 04:58:15 +02:00
parent a2384ca627
commit 8fb9afaddc
3 changed files with 22 additions and 18 deletions

View File

@@ -95,11 +95,11 @@ func TestBlockEncoding(t *testing.T) {
file1 := BlockRecordFile{Hash: hashData([]byte("Test data")), Type: TypeText, Format: FormatText, Size: 9, ID: uuid.New()}
file1.TagsDecoded = append(file1.TagsDecoded, FileTagName{Name: "Filename 1.txt"})
file1.TagsDecoded = append(file1.TagsDecoded, FileTagDirectory{Directory: "documents\\sub folder"})
file1.TagsDecoded = append(file1.TagsDecoded, FileTagFolder{Name: "documents\\sub folder"})
file2 := BlockRecordFile{Hash: hashData([]byte("Test data 2")), Type: TypeText, Format: FormatText, Size: 9, ID: uuid.New()}
file2.TagsDecoded = append(file2.TagsDecoded, FileTagName{Name: "Filename 2.txt"})
file2.TagsDecoded = append(file2.TagsDecoded, FileTagDirectory{Directory: "documents\\sub folder"})
file2.TagsDecoded = append(file2.TagsDecoded, FileTagFolder{Name: "documents\\sub folder"})
encodedFiles, _ := encodeBlockRecordFiles([]BlockRecordFile{file1, file2})
@@ -140,8 +140,8 @@ func TestBlockEncoding(t *testing.T) {
switch v := decodedT.(type) {
case FileTagName:
fmt.Printf(" Name %s\n", v.Name)
case FileTagDirectory:
fmt.Printf(" Directory %s\n", v.Directory)
case FileTagFolder:
fmt.Printf(" Folder %s\n", v.Name)
}
}
}
@@ -164,7 +164,7 @@ func TestBlockchainAdd(t *testing.T) {
file1 := BlockRecordFile{Hash: hashData([]byte("Test data")), Type: TypeText, Format: FormatText, Size: 9, ID: uuid.New()}
file1.TagsDecoded = append(file1.TagsDecoded, FileTagName{Name: "Filename 1.txt"})
file1.TagsDecoded = append(file1.TagsDecoded, FileTagDirectory{Directory: "documents\\sub folder"})
file1.TagsDecoded = append(file1.TagsDecoded, FileTagFolder{Name: "documents\\sub folder"})
newHeight, status := UserBlockchainAddFiles([]BlockRecordFile{file1})
@@ -223,8 +223,8 @@ func TestBlockchainRead(t *testing.T) {
switch v := decodedT.(type) {
case FileTagName:
fmt.Printf(" Name %s\n", v.Name)
case FileTagDirectory:
fmt.Printf(" Directory %s\n", v.Directory)
case FileTagFolder:
fmt.Printf(" Folder %s\n", v.Name)
}
}
}