Skip to content

Instantly share code, notes, and snippets.

@slorello89
Created August 3, 2023 20:14
Show Gist options
  • Save slorello89/3f45c28e20832f24b571d759364c02ee to your computer and use it in GitHub Desktop.
Save slorello89/3f45c28e20832f24b571d759364c02ee to your computer and use it in GitHub Desktop.
resp2_resp3_adhoc_incompatibility
[Theory]
[InlineData(true)]
[InlineData(false)]
public void TryBreakResp3(bool useResp3)
{
var muxer = Fixture.GetConnection(this, useResp3);
var db = muxer.GetDatabase();
db.Execute("DEL", "zset:1");
db.Execute("ZADD", "zset:1", 4, "foo");
var result = db.Execute("ZRANGE", "zset:1", 0, -1, "WITHSCORES");
#pragma warning disable CS0618
Assert.Equal(ResultType.BulkString, ((RedisResult[])result)![1].Type); // works with RESP2
// Assert.Equal(ResultType.Double, ((RedisResult[])(RedisResult[])result[0]!)[1].Resp3Type); // this works with RESP3
#pragma warning restore CS0618
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment