Skip to content

Commit

Permalink
Add keyvalues test for AlternateEnd
Browse files Browse the repository at this point in the history
Fixes #1442
  • Loading branch information
xPaw committed Oct 12, 2024
1 parent 1dbef7c commit 76163ad
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions SteamKit2/Tests/KeyValueFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,21 @@ public void DecodesBinaryWithFieldType10()
Assert.Equal( 0x0807060504030201, kv["key"].AsLong() );
}

[Fact]
public void DecodesBinaryWithAlternateEnd()
{
var hex = "00546573744F626A656374000A6B65790001020304050607080B0B";
var binary = Convert.FromHexString( hex );
var kv = new KeyValue();
using ( var ms = new MemoryStream( binary ) )
{
var read = kv.TryReadAsBinary( ms );
Assert.True( read );
}

Assert.Equal( 0x0807060504030201, kv[ "key" ].AsLong() );
}

static string SaveToText( KeyValue kv )
{
string text;
Expand Down

0 comments on commit 76163ad

Please sign in to comment.