Skip to content

Commit

Permalink
Updated goldens.
Browse files Browse the repository at this point in the history
  • Loading branch information
MeltyPlayer committed Jan 11, 2024
1 parent 2f47db4 commit 88d2621
Show file tree
Hide file tree
Showing 49 changed files with 32 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void TestEnumeratorLinq() {
dict[index1] = "string1";

var values = dict.ToArray();
Asserts.Equal(
Asserts.SequenceEqual(
new[] { "string1", "string3", "string5", },
values);
}
Expand Down
2 changes: 1 addition & 1 deletion FinModelUtility/Fin/Fin Tests/data/KeyframesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ private void AssertKeyframe_(Keyframe<string>? expected,

private void AssertKeyframes_(Keyframes<string> actual,
params Keyframe<string>[] expected) {
Asserts.Equal(expected, actual.Definitions);
Asserts.SequenceEqual(expected, actual.Definitions);
}
}
}
18 changes: 10 additions & 8 deletions FinModelUtility/Fin/Fin Tests/data/ListDictionaryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ public void TestTryGetList() {
Assert.AreEqual(9, impl.Count);

Assert.AreEqual(true, impl.TryGetList("foo", out var fooList));
Asserts.Equal(new[] { "a", "b", "c" }, fooList!);
Asserts.SequenceEqual(new[] { "a", "b", "c" }, fooList!);

Assert.AreEqual(true, impl.TryGetList("bar", out var barList));
Asserts.Equal(new[] { "1", "2", "3" }, barList!);
Asserts.SequenceEqual(new[] { "1", "2", "3" }, barList!);

Assert.AreEqual(true, impl.TryGetList(null, out var nullList));
Asserts.Equal(new[] { "x", "y", "z" }, nullList!);
Asserts.SequenceEqual(new[] { "x", "y", "z" }, nullList!);
}

[Test]
Expand Down Expand Up @@ -95,9 +95,11 @@ public void TestEnumeratorLinq() {
Assert.AreEqual(true, impl.TryGetList("bar", out var barList));
Assert.AreEqual(true, impl.TryGetList(null, out var nullList));

Asserts.Equal(new[] {
("foo", fooList!), ("bar", barList!), (null, nullList!),
},
Asserts.SequenceEqual([
("bar", barList!),
("foo", fooList!),
(null, nullList!),
],
actualValues);
}

Expand Down Expand Up @@ -128,10 +130,10 @@ public void TestEnumeratorManually() {
Assert.AreEqual(true, impl.TryGetList(null, out var nullList));

Assert.AreEqual(true, enumerator.MoveNext());
Assert.AreEqual(("foo", fooList!), enumerator.Current);
Assert.AreEqual(("bar", barList!), enumerator.Current);

Assert.AreEqual(true, enumerator.MoveNext());
Assert.AreEqual(("bar", barList!), enumerator.Current);
Assert.AreEqual(("foo", fooList!), enumerator.Current);

Assert.AreEqual(true, enumerator.MoveNext());
Assert.AreEqual(((string?) null, nullList!), enumerator.Current);
Expand Down
2 changes: 1 addition & 1 deletion FinModelUtility/Fin/Fin Tests/data/SetDictionaryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void TestAdd() {
Assert.AreEqual(2, impl.Count);
Assert.True(impl.TryGetSet("foo", out var outSet));
Assert.AreEqual(outSet!, impl["foo"]);
Asserts.Equal<IEnumerable<string>>(outSet!.Order(), new[] { "bar", "goo"});
Asserts.SequenceEqual<IEnumerable<string>>(outSet!.Order(), new[] { "bar", "goo"});
}

[Test]
Expand Down
4 changes: 2 additions & 2 deletions FinModelUtility/Fin/Fin Tests/data/lazy/LazyArrayTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public void TestEnumerators() {
Assert.AreEqual("foo1", lazyReverseMap[1]);
Assert.AreEqual("foo5", lazyReverseMap[5]);

Asserts.Equal(lazyReverseMap.Keys, new[] { 1, 3, 5 });
Asserts.Equal(lazyReverseMap.Values, new[] { "foo1", "foo3", "foo5" });
Asserts.SequenceEqual(lazyReverseMap.Keys, new[] { 1, 3, 5 });
Asserts.SequenceEqual(lazyReverseMap.Values, new[] { "foo1", "foo3", "foo5" });
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ public void TestEnumerators() {
Assert.AreEqual("rab", lazyReverseMap["bar"]);
Assert.AreEqual("oog", lazyReverseMap["goo"]);

Asserts.Equal<IEnumerable<string>>(lazyReverseMap.Keys.Order(),
Asserts.SequenceEqual<IEnumerable<string>>(lazyReverseMap.Keys.Order(),
new[] { "bar", "foo", "goo" });
Asserts.Equal<IEnumerable<string>>(lazyReverseMap.Values.Order(),
Asserts.SequenceEqual<IEnumerable<string>>(lazyReverseMap.Values.Order(),
new[] { "oof", "oog", "rab", });
}
}
Expand Down
10 changes: 5 additions & 5 deletions FinModelUtility/Fin/Fin Tests/data/nodes/TreeNodeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void TestIterating() {
finQueue.Enqueue(node.ChildNodes);
}

Asserts.Equal<IEnumerable<string>>(
Asserts.SequenceEqual<IEnumerable<string>>(
actualValues,
new[] { "root", "foo", "bar", "123", "abc" });
}
Expand All @@ -55,7 +55,7 @@ public void TestAncestors() {
}
}

Asserts.Equal<IEnumerable<string>>(
Asserts.SequenceEqual<IEnumerable<string>>(
actualValues,
new[] { "123", "foo", "root" });
}
Expand All @@ -73,17 +73,17 @@ public void TestReplacingParent() {

nodeChild.Parent = nodeFoo;
Assert.AreEqual(nodeFoo, nodeChild.Parent);
Asserts.Equal(nodeFoo.ChildNodes, new[] { nodeChild });
Asserts.SequenceEqual(nodeFoo.ChildNodes, new[] { nodeChild });
Assert.AreEqual(0, nodeBar.ChildNodes.Count());

nodeBar.AddChild(nodeChild);
Assert.AreEqual(nodeBar, nodeChild.Parent);
Asserts.Equal(nodeBar.ChildNodes, new[] { nodeChild });
Asserts.SequenceEqual(nodeBar.ChildNodes, new[] { nodeChild });
Assert.AreEqual(0, nodeFoo.ChildNodes.Count());

nodeChild.Parent = nodeFoo;
Assert.AreEqual(nodeFoo, nodeChild.Parent);
Asserts.Equal(nodeFoo.ChildNodes, new[] { nodeChild });
Asserts.SequenceEqual(nodeFoo.ChildNodes, new[] { nodeChild });
Assert.AreEqual(0, nodeBar.ChildNodes.Count());
}
}
Expand Down
2 changes: 1 addition & 1 deletion FinModelUtility/Fin/Fin Tests/data/queue/FinQueueTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void TestEnumeratorLinq() {
var queue = new FinQueue<string>(expectedValues);

var actualValues = queue.ToArray();
Asserts.Equal(expectedValues, actualValues);
Asserts.SequenceEqual(expectedValues, actualValues);
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void TestEnumeratorLinq() {
var queue = new FinQueue<(string, string)>(expectedValues);

var actualValues = queue.ToArray();
Asserts.Equal(expectedValues, actualValues);
Asserts.SequenceEqual(expectedValues, actualValues);
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void TestOrder() {
"bar1", "bar2", "bar5", "bar10", "foo1", "foo3", "foo13",
};

Asserts.Equal<IEnumerable<string>>(
Asserts.SequenceEqual<IEnumerable<string>>(
expectedOutputStrings,
inputStrings.OrderBy(value => value,
new StringNumberSuffixComparer()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public IAudioBuffer<short> ImportAudio(
IAudioManager<short> audioManager,
OggAudioFileBundle audioFileBundle) {
var oggFile = audioFileBundle.OggFile;
Asserts.Equal(".ogg", oggFile.FileType.ToLower());
Asserts.SequenceEqual(".ogg", oggFile.FileType.ToLower());

using var ogg = new VorbisReader(oggFile.OpenRead());

Expand Down
2 changes: 1 addition & 1 deletion FinModelUtility/Fin/Fin/src/util/asserts/Asserts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static bool Equal(
return false;
}

public static void Equal<TEnumerable>(
public static void SequenceEqual<TEnumerable>(
TEnumerable enumerableA,
TEnumerable enumerableB) where TEnumerable : IEnumerable {
var enumeratorA = enumerableA.GetEnumerator();
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void Read(IBinaryReader br) {
out sectionSize);
}

Asserts.Equal("MATL", sectionName);
Asserts.SequenceEqual("MATL", sectionName);

var materialSize = 0x48;
Asserts.Equal(0, sectionSize % materialSize);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void Read(IBinaryReader br) {
SectionHeaderUtil.ReadNameAndSize(br, out sectionName, out sectionSize);
}

Asserts.Equal("MATL", sectionName);
Asserts.SequenceEqual("MATL", sectionName);

var materialSize = 0xA4;
Asserts.Equal(0, sectionSize % materialSize);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ private void ImportMesh(byte[] bytes, ModelImpl finModel) {

var fromBone = this.VisSubModelRef?.FromBone;
if (fromBone != null) {
Asserts.Equal(fromBone, skeletonHeader.Bones[0].Name);
Asserts.SequenceEqual(fromBone, skeletonHeader.Bones[0].Name);
}

var rootBone = finModel.Skeleton.Root;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var nodes
.ToArray();

for (var i = 0; i < nodeCount; ++i) {
Asserts.Equal("{", lines[lineIndex++]);
Asserts.SequenceEqual("{", lines[lineIndex++]);
var nodeIndex = int.Parse(lines[lineIndex++]);
var node = nodes[nodeIndex];

Expand All @@ -55,7 +55,7 @@ var nodes
Radius = floats[3],
};

Asserts.Equal("}", lines[lineIndex++]);
Asserts.SequenceEqual("}", lines[lineIndex++]);
}

return nodes;
Expand Down

0 comments on commit 88d2621

Please sign in to comment.