Skip to content

Commit bf80fc7

Browse files
authored
Merge pull request #499 from M4xymm/v7.1
Fix failing test for `CompareExchange`, now Delete should throw error.
2 parents c8b9ee8 + c2dc3cd commit bf80fc7

File tree

1 file changed

+9
-23
lines changed

1 file changed

+9
-23
lines changed

test/Ported/UniqueValuesTest.ts

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -156,33 +156,19 @@ describe("UniqueValuesTest", function () {
156156
assert.strictEqual(readValue.value, "Karmel");
157157
});
158158

159-
it("tryingToDeleteNonExistingKeyShouldNotThrow", async () => {
160-
const res1= await store.operations.send(
159+
it("tryingToDeleteNonExistingKeyShouldThrow", async () => {
160+
const res1 = await store.operations.send(
161161
new PutCompareExchangeValueOperation<string>("key/1", "Name", 0));
162162

163163
assert.strictEqual(res1.value, "Name");
164164
assert.ok(res1.successful);
165-
166-
const res2 = await store.operations.send(
167-
new DeleteCompareExchangeValueOperation<string>("key/2", res1.index));
168-
169-
assert.ok(res2.successful);
170-
assert.equal(res2.value, null);
171-
assert.equal(res2.index, res1.index + 1);
172-
173-
const res3 = await store.operations.send(
174-
new DeleteCompareExchangeValueOperation<string>("key/2", 0));
175-
176-
assert.ok(res3.successful);
177-
assert.equal(res3.value, null);
178-
assert.equal(res3.index, res2.index + 1);
179-
180-
const res4 = await store.operations.send(
181-
new DeleteCompareExchangeValueOperation<string>("key/2", 999));
182-
183-
assert.ok(res4.successful);
184-
assert.equal(res4.value, null);
185-
assert.equal(res4.index, res3.index + 1);
165+
try {
166+
await store.operations.send(
167+
new DeleteCompareExchangeValueOperation<string>("key/2", 0));
168+
assert.fail("should have thrown");
169+
} catch (e) {
170+
assert.strictEqual(e.name, "RavenException")
171+
}
186172
});
187173

188174
it("returnCurrentValueWhenPuttingConcurrently", async () => {

0 commit comments

Comments
 (0)