@rotorsoft/act-tck 1.41.3 → 1.41.4
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 +14 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1098,6 +1098,7 @@ import {
|
|
|
1098
1098
|
act,
|
|
1099
1099
|
ConcurrencyError,
|
|
1100
1100
|
InMemoryCache,
|
|
1101
|
+
is_literal_source,
|
|
1101
1102
|
SNAP_EVENT as SNAP_EVENT2,
|
|
1102
1103
|
sensitive,
|
|
1103
1104
|
sleep,
|
|
@@ -1111,7 +1112,6 @@ var runStoreTck = (options) => {
|
|
|
1111
1112
|
describe8(`TCK / Store / ${options.name}`, () => {
|
|
1112
1113
|
let store;
|
|
1113
1114
|
const caps = { ...options.capabilities };
|
|
1114
|
-
const is_literal = (source) => !/[\]^$.*+?()[{}|\\]/.test(source);
|
|
1115
1115
|
const correlate = async (target = store) => {
|
|
1116
1116
|
const rows = [];
|
|
1117
1117
|
await target.query_streams(
|
|
@@ -1131,7 +1131,10 @@ var runStoreTck = (options) => {
|
|
|
1131
1131
|
(e) => {
|
|
1132
1132
|
mark = Math.max(mark, e.id);
|
|
1133
1133
|
},
|
|
1134
|
-
row.source !== void 0 ? {
|
|
1134
|
+
row.source !== void 0 ? {
|
|
1135
|
+
stream: row.source,
|
|
1136
|
+
stream_exact: is_literal_source(row.source, row.stream)
|
|
1137
|
+
} : {}
|
|
1135
1138
|
);
|
|
1136
1139
|
if (mark > row.at)
|
|
1137
1140
|
marks.push({
|
|
@@ -1885,6 +1888,16 @@ var runStoreTck = (options) => {
|
|
|
1885
1888
|
const leases = await store.claim(5, 5, `w-${uid()}`, 5e3);
|
|
1886
1889
|
expect8(leases.filter((l) => l.stream === s)).toHaveLength(0);
|
|
1887
1890
|
});
|
|
1891
|
+
it7("takes a target reading itself, whatever its name holds", async () => {
|
|
1892
|
+
const name = `self-a+b(${uid()}`;
|
|
1893
|
+
await store.subscribe([{ stream: name, source: name }]);
|
|
1894
|
+
const found = [];
|
|
1895
|
+
await store.query_streams((p) => found.push(p.stream), {
|
|
1896
|
+
stream: name,
|
|
1897
|
+
stream_exact: true
|
|
1898
|
+
});
|
|
1899
|
+
expect8(found).toEqual([name]);
|
|
1900
|
+
});
|
|
1888
1901
|
it7("claims a fresh subscription as soon as its first event is marked", async () => {
|
|
1889
1902
|
const s = `fresh-first-${uid()}`;
|
|
1890
1903
|
const src = `fresh-first-src-${uid()}`;
|