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

DataStream.Compare with itself doesn't work properly #189

Closed
priverop opened this issue Aug 20, 2022 · 0 comments · Fixed by #199
Closed

DataStream.Compare with itself doesn't work properly #189

priverop opened this issue Aug 20, 2022 · 0 comments · Fixed by #199
Assignees
Labels
Milestone

Comments

@priverop
Copy link
Member

Describe the bug
DataStream.Compare returns false when it should return true when comparing a Stream with itself.

To Reproduce
Using Yarhl 4.0.0-preview.157.

    public class TestObject : IBinary
    {
        public TestObject(DataStream fileStream)
        {
            Stream = fileStream;
        }

        public DataStream Stream { get; set; }
}

public void Test(){
            var streamA = new DataStream();
            streamA.Write(new byte[] { 1, 2, 3 }, 0, 3);

            var alarFile = new TestObject(streamA);

            var streamB = new DataStream();
            streamB.Write(new byte[] { 2, 3, 4 }, 0, 3);

            alarFile.Stream = streamB;

            alarFile.Stream.Compare(streamB).Should().BeTrue();
}

Expected behavior
That test should pass. Compare() should return true.

Desktop (please complete the following information):

  • OS: Mac
  • Version 10.15.7
@pleonex pleonex added this to the vNext milestone Mar 3, 2023
@pleonex pleonex self-assigned this Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants