@rotorsoft/act-tck 1.27.39 → 1.27.41
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 +51 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -2950,7 +2950,58 @@ var runStoreTck = (options) => {
|
|
|
2950
2950
|
expect8(blocked.get(b)).toBe(true);
|
|
2951
2951
|
});
|
|
2952
2952
|
});
|
|
2953
|
+
describe8("long identifiers", () => {
|
|
2954
|
+
it7("accepts a stream name well past 100 characters (#1420)", async () => {
|
|
2955
|
+
const tag = uid();
|
|
2956
|
+
const long = `${tag}-${"x".repeat(140)}`;
|
|
2957
|
+
await store.commit(
|
|
2958
|
+
long,
|
|
2959
|
+
[inc(1)],
|
|
2960
|
+
make_meta({ stream: long })
|
|
2961
|
+
);
|
|
2962
|
+
await store.subscribe([
|
|
2963
|
+
{ stream: `__autoclose__:${long}`, source: long }
|
|
2964
|
+
]);
|
|
2965
|
+
const seen = [];
|
|
2966
|
+
await store.query((e) => seen.push(e.stream), {
|
|
2967
|
+
stream: long,
|
|
2968
|
+
stream_exact: true
|
|
2969
|
+
});
|
|
2970
|
+
expect8(seen).toEqual([long]);
|
|
2971
|
+
const subs = [];
|
|
2972
|
+
await store.query_streams((p) => subs.push(p.stream), { limit: 500 });
|
|
2973
|
+
expect8(subs).toContain(`__autoclose__:${long}`);
|
|
2974
|
+
});
|
|
2975
|
+
});
|
|
2953
2976
|
describe8("truncate", () => {
|
|
2977
|
+
it7("keeps the subscription row for a restart target, drops it for a retire (#1398)", async () => {
|
|
2978
|
+
const tag = uid();
|
|
2979
|
+
const restarted = `trunc-restart-${tag}`;
|
|
2980
|
+
const retired = `trunc-retire-${tag}`;
|
|
2981
|
+
for (const s of [restarted, retired]) {
|
|
2982
|
+
await store.subscribe([{ stream: s }]);
|
|
2983
|
+
await store.commit(
|
|
2984
|
+
s,
|
|
2985
|
+
[inc(1)],
|
|
2986
|
+
make_meta({ stream: s })
|
|
2987
|
+
);
|
|
2988
|
+
}
|
|
2989
|
+
await store.truncate([
|
|
2990
|
+
{
|
|
2991
|
+
stream: restarted,
|
|
2992
|
+
snapshot: { count: 1 },
|
|
2993
|
+
meta: make_meta({ stream: restarted })
|
|
2994
|
+
},
|
|
2995
|
+
{ stream: retired, meta: make_meta({ stream: retired }) }
|
|
2996
|
+
]);
|
|
2997
|
+
const rows = [];
|
|
2998
|
+
await store.query_streams((p) => rows.push(p.stream), {
|
|
2999
|
+
stream: `trunc-.*-${tag}`,
|
|
3000
|
+
limit: 100
|
|
3001
|
+
});
|
|
3002
|
+
expect8(rows).toContain(restarted);
|
|
3003
|
+
expect8(rows).not.toContain(retired);
|
|
3004
|
+
});
|
|
2954
3005
|
it7("seeds a tombstone when no snapshot is provided", async () => {
|
|
2955
3006
|
const s = `trunc-tomb-${uid()}`;
|
|
2956
3007
|
await store.commit(
|