Skip to content

Commit 1163af8

Browse files
committed
add zero-length digest test
1 parent 5935114 commit 1163af8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/StackExchange.Redis/RedisDatabase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1832,7 +1832,7 @@ public bool LockRelease(RedisKey key, RedisValue value, CommandFlags flags = Com
18321832
if (value.IsNull) throw new ArgumentNullException(nameof(value));
18331833

18341834
// note that lock tokens are expected to be small, so: we'll use IFEQ rather than IFDEQ, for reliability
1835-
var features = GetFeatures(key, flags, RedisCommand.SET, out server);
1835+
var features = GetFeatures(key, flags, RedisCommand.DELEX, out server);
18361836
return features.DeleteWithValueCheck
18371837
? GetStringDeleteMessage(key, ValueCondition.Equal(value), flags, caller) // use check-and-delete
18381838
: null;

tests/StackExchange.Redis.Tests/DigestUnitTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ public void ValueCondition_ParseDigest(string value)
5757
[Theory]
5858
[InlineData("Hello World", "e34615aade2e6333")]
5959
[InlineData("42", "1217cb28c0ef2191")]
60+
[InlineData("", "2d06800538d394c2")]
61+
[InlineData("a", "e6c632b61e964e1f")]
6062
public void KnownXxh3Values(string source, string expected)
6163
=> Assert.Equal(expected, GetXxh3Hex(source));
6264

0 commit comments

Comments
 (0)