Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added capture of server console input for hotkeys #2085

Merged
merged 3 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fixed CircularBufer.LastIndexChanged and unit test for Clear
  • Loading branch information
Measurity committed Nov 29, 2023
commit d146ae58043c0b3f1bfa68244a009a6c8f3664db
8 changes: 7 additions & 1 deletion Nitrox.Test/Model/DataStructures/CircularBufferTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public void ShouldOverwriteOldestItemInBufferWhenCapped()
buffer[2].Should().Be("3");
buffer.Add("6");
buffer[2].Should().Be("6");
buffer.Add("7");
buffer.Should().ContainInOrder("7", "5", "6");
}

[TestMethod]
Expand Down Expand Up @@ -91,7 +93,11 @@ public void ShouldGiveLastChanged()
buffer.Add(6);
buffer.LastChangedIndex.Should().Be(2);
buffer.Add(7);
buffer.Should().ContainInOrder(7, 5, 6);
buffer.LastChangedIndex.Should().Be(0);
buffer.Add(8);
buffer.LastChangedIndex.Should().Be(1);
buffer.Clear();
buffer.LastChangedIndex.Should().Be(-1);
}

[TestMethod]
Expand Down
2 changes: 1 addition & 1 deletion NitroxModel/DataStructures/CircularBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void AddRange(params T[] items)
public void Clear()
{
data.Clear();
LastChangedIndex = 0;
LastChangedIndex = -1;
}

public bool Contains(T item)
Expand Down