A few test fixes

This commit is contained in:
Timothy Baldridge 2020-03-23 20:58:39 -06:00
parent ccaaab318c
commit a2cf84de54
2 changed files with 8 additions and 6 deletions

View File

@ -350,12 +350,14 @@ namespace Wabbajack.Common
public static bool operator ==(Extension a, Extension b)
{
// Super fast comparison because extensions are interned
if (a == null && b == null) return true;
if (a == null || b == null) return false;
return ReferenceEquals(a._extension, b._extension);
}
public static bool operator !=(Extension a, Extension b)
{
return !ReferenceEquals(a._extension, b._extension);
return !(a == b);
}
}

View File

@ -177,16 +177,16 @@ namespace Wabbajack.VirtualFileSystem.Test
var state = context.GetPortableState(files);
var new_context = new Context(Queue);
var newContext = new Context(Queue);
await new_context.IntegrateFromPortable(state,
await newContext.IntegrateFromPortable(state,
new Dictionary<Hash, AbsolutePath> {{archive.Hash, archive.FullPath.Base}});
var new_files = new_context.Index.ByHash[Hash.FromBase64("qX0GZvIaTKM=")];
var newFiles = newContext.Index.ByHash[Hash.FromBase64("qX0GZvIaTKM=")];
var close = await new_context.Stage(new_files);
var close = await newContext.Stage(newFiles);
foreach (var file in new_files)
foreach (var file in newFiles)
Assert.AreEqual("This is a test", await file.StagedPath.ReadAllTextAsync());
close();