@rotorsoft/act-tck 1.30.0 → 1.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/@types/store-tck.d.ts.map +1 -1
- package/dist/index.cjs +40 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-tck.d.ts","sourceRoot":"","sources":["../../src/store-tck.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAQV,KAAK,EAGN,MAAM,sBAAsB,CAAC;AAc9B;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;;OAOG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC;;;;;;;;;OASG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACpC;;;;;;;;OAQG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IACxC;;;;;;;;OAQG;IACH,QAAQ,CAAC,gCAAgC,CAAC,EAAE,OAAO,CAAC;CACrD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/C;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,QAAQ,CAA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AAG,OAAO,CAAC,KAAK,CAAC,CAAC;IACxD;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,iBAAiB,CAAC;CAC3C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,WAAW,YAAa,eAAe,KAAG,IAq6ItD,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1738,6 +1738,46 @@ var runStoreTck = (options) => {
|
|
|
1738
1738
|
await store.subscribe([{ stream: s }]);
|
|
1739
1739
|
(0, import_vitest9.expect)(await read()).toBe(10);
|
|
1740
1740
|
});
|
|
1741
|
+
(0, import_vitest9.it)("keeps the maximum for negative and zero priorities too", async () => {
|
|
1742
|
+
const s = `sub-pri-neg-${uid()}`;
|
|
1743
|
+
const read = async () => {
|
|
1744
|
+
const got = {};
|
|
1745
|
+
await store.query_streams(
|
|
1746
|
+
(p) => {
|
|
1747
|
+
got.priority = p.priority;
|
|
1748
|
+
},
|
|
1749
|
+
{ stream: s, stream_exact: true }
|
|
1750
|
+
);
|
|
1751
|
+
return got.priority;
|
|
1752
|
+
};
|
|
1753
|
+
await store.subscribe([{ stream: s, priority: -5 }]);
|
|
1754
|
+
(0, import_vitest9.expect)(await read()).toBe(-5);
|
|
1755
|
+
await store.subscribe([{ stream: s, priority: -1 }]);
|
|
1756
|
+
(0, import_vitest9.expect)(await read()).toBe(-1);
|
|
1757
|
+
await store.subscribe([{ stream: s, priority: -9 }]);
|
|
1758
|
+
(0, import_vitest9.expect)(await read()).toBe(-1);
|
|
1759
|
+
await store.subscribe([{ stream: s }]);
|
|
1760
|
+
(0, import_vitest9.expect)(await read()).toBe(0);
|
|
1761
|
+
});
|
|
1762
|
+
(0, import_vitest9.it)("restores the declared priority on the next subscribe after a prioritize() downgrade", async () => {
|
|
1763
|
+
const s = `sub-pri-restore-${uid()}`;
|
|
1764
|
+
const read = async () => {
|
|
1765
|
+
const got = {};
|
|
1766
|
+
await store.query_streams(
|
|
1767
|
+
(p) => {
|
|
1768
|
+
got.priority = p.priority;
|
|
1769
|
+
},
|
|
1770
|
+
{ stream: s, stream_exact: true }
|
|
1771
|
+
);
|
|
1772
|
+
return got.priority;
|
|
1773
|
+
};
|
|
1774
|
+
await store.subscribe([{ stream: s }]);
|
|
1775
|
+
(0, import_vitest9.expect)(await read()).toBe(0);
|
|
1776
|
+
await store.prioritize({ stream: s, stream_exact: true }, -5);
|
|
1777
|
+
(0, import_vitest9.expect)(await read()).toBe(-5);
|
|
1778
|
+
await store.subscribe([{ stream: s }]);
|
|
1779
|
+
(0, import_vitest9.expect)(await read()).toBe(0);
|
|
1780
|
+
});
|
|
1741
1781
|
(0, import_vitest9.it)("claims a subscribed stream and ack releases the lease", async () => {
|
|
1742
1782
|
const s = `claim-${uid()}`;
|
|
1743
1783
|
await store.subscribe([{ stream: s }]);
|