mirror of
https://github.com/softinio/Fishee.git
synced 2025-09-05 11:56:41 -07:00
complete backup functionality
This commit is contained in:
parent
9dd3399d5c
commit
02f14b70bf
3 changed files with 17 additions and 10 deletions
|
@ -27,7 +27,7 @@ final class ParserTests {
|
|||
"myfile.txt"
|
||||
)
|
||||
let filePathforFileBackupTest = FileManager.default.urls(for: .downloadsDirectory, in: .userDomainMask)[0].appendingPathComponent(
|
||||
"myfile.txt_copy"
|
||||
"myfile_copy.txt"
|
||||
)
|
||||
|
||||
deinit {
|
||||
|
@ -51,7 +51,7 @@ final class ParserTests {
|
|||
let written = writeFishHistory(
|
||||
to: filePathforWriteTest.path,
|
||||
history: [historyItem],
|
||||
historyFileLocation: fishHistoryFile
|
||||
backup: false
|
||||
)
|
||||
#expect(written)
|
||||
|
||||
|
@ -64,6 +64,14 @@ final class ParserTests {
|
|||
|
||||
"""
|
||||
#expect(fileContent == expectedEntry)
|
||||
|
||||
// confirm backup functionality is working
|
||||
let write_again = writeFishHistory(
|
||||
to: filePathforWriteTest.path,
|
||||
history: [historyItem],
|
||||
backup: true
|
||||
)
|
||||
#expect(write_again)
|
||||
#expect(FileManager.default.fileExists(atPath: filePathforFileBackupTest.path))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue