diff options
Diffstat (limited to 'Duplicati/UnitTest/ProblematicPathTests.cs')
-rw-r--r-- | Duplicati/UnitTest/ProblematicPathTests.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Duplicati/UnitTest/ProblematicPathTests.cs b/Duplicati/UnitTest/ProblematicPathTests.cs index be7aed09c..85d3cebd8 100644 --- a/Duplicati/UnitTest/ProblematicPathTests.cs +++ b/Duplicati/UnitTest/ProblematicPathTests.cs @@ -274,6 +274,8 @@ namespace Duplicati.UnitTest } Dictionary<string, string> restoreOptions = new Dictionary<string, string>(this.TestOptions) {["restore-path"] = this.RESTOREFOLDER}; + + // Restore just the file. using (Controller c = new Controller("file://" + this.TARGETFOLDER, restoreOptions, null)) { IRestoreResults restoreResults = c.Restore(new[] {filePath}); @@ -283,6 +285,18 @@ namespace Duplicati.UnitTest string restoreFilePath = SystemIO.IO_OS.PathCombine(this.RESTOREFOLDER, pathComponent); TestUtils.AssertFilesAreEqual(filePath, restoreFilePath, true, pathComponent); + SystemIO.IO_OS.FileDelete(restoreFilePath); + + // Restore the entire directory. + string pathSpec = $"[{Util.AppendDirSeparator(this.DATAFOLDER)}.*]"; + using (Controller c = new Controller("file://" + this.TARGETFOLDER, restoreOptions, null)) + { + IRestoreResults restoreResults = c.Restore(new[] {pathSpec}); + Assert.AreEqual(0, restoreResults.Errors.Count()); + Assert.AreEqual(0, restoreResults.Warnings.Count()); + } + + TestUtils.AssertDirectoryTreesAreEquivalent(this.DATAFOLDER, this.RESTOREFOLDER, true, pathComponent); } } }
\ No newline at end of file |