@fncts/test 0.0.32 → 0.0.33
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/_cjs/api.cjs +5 -5
- package/_cjs/api.cjs.map +1 -1
- package/_cjs/control/AbstractRunnableSpec.cjs +1 -1
- package/_cjs/control/AbstractRunnableSpec.cjs.map +1 -1
- package/_cjs/control/Assertion/api.cjs +6 -5
- package/_cjs/control/Assertion/api.cjs.map +1 -1
- package/_cjs/control/DefaultTestReporter/render.cjs +1 -1
- package/_cjs/control/DefaultTestReporter/render.cjs.map +1 -1
- package/_cjs/control/Gen/api.cjs +216 -78
- package/_cjs/control/Gen/api.cjs.map +1 -1
- package/_cjs/control/Live/definition.cjs +9 -8
- package/_cjs/control/Live/definition.cjs.map +1 -1
- package/_cjs/control/Sample/api.cjs +16 -16
- package/_cjs/control/Sample/api.cjs.map +1 -1
- package/_cjs/control/Spec/api.cjs +7 -7
- package/_cjs/control/Spec/api.cjs.map +1 -1
- package/_cjs/control/TestAnnotationRenderer/api.cjs +6 -5
- package/_cjs/control/TestAnnotationRenderer/api.cjs.map +1 -1
- package/_cjs/control/TestAspect/api.cjs +2 -3
- package/_cjs/control/TestAspect/api.cjs.map +1 -1
- package/_cjs/control/TestClock/definition.cjs +6 -6
- package/_cjs/control/TestClock/definition.cjs.map +1 -1
- package/_cjs/data/AssertionResult.cjs +3 -2
- package/_cjs/data/AssertionResult.cjs.map +1 -1
- package/_cjs/data/AssertionValue/definition.cjs +2 -1
- package/_cjs/data/AssertionValue/definition.cjs.map +1 -1
- package/_cjs/data/FreeBooleanAlgebra/api.cjs +5 -4
- package/_cjs/data/FreeBooleanAlgebra/api.cjs.map +1 -1
- package/_cjs/data/TestAnnotation/api.cjs +3 -2
- package/_cjs/data/TestAnnotation/api.cjs.map +1 -1
- package/_cjs/demo.cjs +1 -1
- package/_mjs/api.mjs +5 -5
- package/_mjs/api.mjs.map +1 -1
- package/_mjs/control/AbstractRunnableSpec.mjs +1 -1
- package/_mjs/control/AbstractRunnableSpec.mjs.map +1 -1
- package/_mjs/control/Assertion/api.mjs +6 -5
- package/_mjs/control/Assertion/api.mjs.map +1 -1
- package/_mjs/control/DefaultTestReporter/render.mjs +1 -1
- package/_mjs/control/DefaultTestReporter/render.mjs.map +1 -1
- package/_mjs/control/Gen/api.mjs +198 -71
- package/_mjs/control/Gen/api.mjs.map +1 -1
- package/_mjs/control/Live/definition.mjs +8 -7
- package/_mjs/control/Live/definition.mjs.map +1 -1
- package/_mjs/control/Sample/api.mjs +16 -16
- package/_mjs/control/Sample/api.mjs.map +1 -1
- package/_mjs/control/Spec/api.mjs +7 -7
- package/_mjs/control/Spec/api.mjs.map +1 -1
- package/_mjs/control/TestAnnotationRenderer/api.mjs +6 -5
- package/_mjs/control/TestAnnotationRenderer/api.mjs.map +1 -1
- package/_mjs/control/TestAspect/api.mjs +2 -3
- package/_mjs/control/TestAspect/api.mjs.map +1 -1
- package/_mjs/control/TestClock/definition.mjs +6 -6
- package/_mjs/control/TestClock/definition.mjs.map +1 -1
- package/_mjs/data/AssertionResult.mjs +3 -2
- package/_mjs/data/AssertionResult.mjs.map +1 -1
- package/_mjs/data/AssertionValue/definition.mjs +2 -1
- package/_mjs/data/AssertionValue/definition.mjs.map +1 -1
- package/_mjs/data/FreeBooleanAlgebra/api.mjs +5 -4
- package/_mjs/data/FreeBooleanAlgebra/api.mjs.map +1 -1
- package/_mjs/data/TestAnnotation/api.mjs +3 -2
- package/_mjs/data/TestAnnotation/api.mjs.map +1 -1
- package/_mjs/demo.mjs +1 -1
- package/_src/api.ts +1 -1
- package/_src/control/Gen/api.ts +166 -1
- package/_src/control/Live/definition.ts +8 -9
- package/_src/control/TestAspect/api.ts +2 -2
- package/_src/demo.ts +1 -1
- package/api.d.ts +1 -1
- package/control/Gen/api.d.ts +46 -1
- package/control/Live/definition.d.ts +6 -2
- package/package.json +3 -3
@@ -1,6 +1,7 @@
|
|
1
|
+
const fileName_1 = "(@fncts/test) src/data/AssertionResult.ts";
|
1
2
|
import * as tsplus_module_1 from "@fncts/base/data/Maybe/constructors";
|
2
3
|
export class FailureDetailsResult {
|
3
|
-
constructor(failureDetails, genFailureDetails = tsplus_module_1.nothing()) {
|
4
|
+
constructor(failureDetails, genFailureDetails = tsplus_module_1.nothing(fileName_1 + ":7:67")) {
|
4
5
|
this.failureDetails = failureDetails;
|
5
6
|
this.genFailureDetails = genFailureDetails;
|
6
7
|
}
|
@@ -9,7 +10,7 @@ export const AssertionResult = {};
|
|
9
10
|
/**
|
10
11
|
* @tsplus static fncts.test.data.AssertionResultOps FailureDetailsResult
|
11
12
|
*/
|
12
|
-
export function failureDetailsResult(failureDetails, genFailureDetails = tsplus_module_1.nothing()) {
|
13
|
+
export function failureDetailsResult(failureDetails, genFailureDetails = tsplus_module_1.nothing(fileName_1 + ":28:56")) {
|
13
14
|
return new FailureDetailsResult(failureDetails, genFailureDetails);
|
14
15
|
}
|
15
16
|
//# sourceMappingURL=AssertionResult.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AssertionResult.mjs","mappings":"
|
1
|
+
{"version":3,"file":"AssertionResult.mjs","mappings":";;AAGA,OAAM,MAAOA,oBAAoB;EAC/BC,YACWC,cAA8B,EAC9BC,oBAA8CC,6CAAS;IADvD,mBAAc,GAAdF,cAAc;IACd,sBAAiB,GAAjBC,iBAAiB;EACzB;;AAaL,OAAO,MAAME,eAAe,GAAuB,EAAE;AAErD;;;AAGA,OAAM,SAAUC,oBAAoB,CAClCJ,cAA8B,EAC9BC,oBAA8CC,8CAAS;EAEvD,OAAO,IAAIJ,oBAAoB,CAACE,cAAc,EAAEC,iBAAiB,CAAC;AACpE","names":["FailureDetailsResult","constructor","failureDetails","genFailureDetails","tsplus_module_1","AssertionResult","failureDetailsResult"],"sourceRoot":"","sources":["../../_src/data/AssertionResult.ts"],"sourcesContent":[null]}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
var _a;
|
2
|
+
const fileName_1 = "(@fncts/test) src/data/AssertionValue/definition.ts";
|
2
3
|
import * as tsplus_module_1 from "@fncts/base/data/Maybe/constructors";
|
3
4
|
export const AssertionValueTypeId = /*#__PURE__*/Symbol.for("fncts.test.data.AssertionValue");
|
4
5
|
/**
|
@@ -6,7 +7,7 @@ export const AssertionValueTypeId = /*#__PURE__*/Symbol.for("fncts.test.data.Ass
|
|
6
7
|
* @tsplus companion fncts.test.data.AssertionValueOps
|
7
8
|
*/
|
8
9
|
export class AssertionValue {
|
9
|
-
constructor(assertion, value, result, expression = tsplus_module_1.nothing(), sourceLocation = tsplus_module_1.nothing()) {
|
10
|
+
constructor(assertion, value, result, expression = tsplus_module_1.nothing(fileName_1 + ":16:49"), sourceLocation = tsplus_module_1.nothing(fileName_1 + ":17:53")) {
|
10
11
|
this.assertion = assertion;
|
11
12
|
this.value = value;
|
12
13
|
this.result = result;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.mjs","mappings":"
|
1
|
+
{"version":3,"file":"definition.mjs","mappings":";;;AAEA,OAAO,MAAMA,oBAAoB,gBAAGC,MAAM,CAACC,GAAG,CAAC,gCAAgC,CAAC;AAGhF;;;;AAIA,OAAM,MAAOC,cAAc;EAEzBC,YACWC,SAAoC,EACpCC,KAAQ,EACRC,MAAwD,EACxDC,aAA4BC,8CAAS,EACrCC,iBAAgCD,8CAAS;IAJzC,cAAS,GAATJ,SAAS;IACT,UAAK,GAALC,KAAK;IACL,WAAM,GAANC,MAAM;IACN,eAAU,GAAVC,UAAU;IACV,mBAAc,GAAdE,cAAc;IANhB,QAAsB,GAAyBV,oBAAoB;EAOzE;;KAPOA,oBAAoB","names":["AssertionValueTypeId","Symbol","for","AssertionValue","constructor","assertion","value","result","expression","tsplus_module_1","sourceLocation"],"sourceRoot":"","sources":["../../../_src/data/AssertionValue/definition.ts"],"sourcesContent":[null]}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
const fileName_1 = "(@fncts/test) src/data/FreeBooleanAlgebra/api.ts";
|
1
2
|
import * as tsplus_module_1 from "@fncts/base/data/Maybe/constructors";
|
2
3
|
import * as tsplus_module_2 from "@fncts/base/data/Either/constructors";
|
3
4
|
import * as tsplus_module_3 from "@fncts/base/data/Either/api";
|
@@ -55,17 +56,17 @@ export function failure(a) {
|
|
55
56
|
* @tsplus getter fncts.test.FreeBooleanAlgebra failures
|
56
57
|
*/
|
57
58
|
export function failures(self) {
|
58
|
-
return tsplus_module_4.match(tsplus_module_1.just, () => tsplus_module_1.nothing())(fold_1({
|
59
|
-
Value: a => tsplus_module_2.right(success_1(a)),
|
59
|
+
return tsplus_module_4.match(tsplus_module_1.just, () => tsplus_module_1.nothing(fileName_1 + ":74:37"))(fold_1({
|
60
|
+
Value: a => tsplus_module_2.right(success_1(a), fileName_1 + ":49:33"),
|
60
61
|
And: (l, r) => {
|
61
62
|
void 0;
|
62
63
|
void 0;
|
63
|
-
return tsplus_module_3.isRight(l) ? tsplus_module_3.isRight(r) ? tsplus_module_2.right(and_1(r.right)(l.right)) : r : tsplus_module_3.isRight(r) ? l : tsplus_module_2.left(and_1(r.left)(l.left));
|
64
|
+
return tsplus_module_3.isRight(l) ? tsplus_module_3.isRight(r) ? tsplus_module_2.right(and_1(r.right)(l.right), fileName_1 + ":55:27") : r : tsplus_module_3.isRight(r) ? l : tsplus_module_2.left(and_1(r.left)(l.left), fileName_1 + ":59:24");
|
64
65
|
},
|
65
66
|
Or: (l, r) => {
|
66
67
|
void 0;
|
67
68
|
void 0;
|
68
|
-
return tsplus_module_3.isRight(l) ? tsplus_module_3.isRight(r) ? tsplus_module_2.right(or_1(r.right)(l.right)) : l : tsplus_module_3.isRight(r) ? r : tsplus_module_2.left(or_1(r.left)(l.left));
|
69
|
+
return tsplus_module_3.isRight(l) ? tsplus_module_3.isRight(r) ? tsplus_module_2.right(or_1(r.right)(l.right), fileName_1 + ":66:27") : l : tsplus_module_3.isRight(r) ? r : tsplus_module_2.left(or_1(r.left)(l.left), fileName_1 + ":70:24");
|
69
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C;AACH;AAEA;;;AAGA,mBAA2Ba,CAAI;EAC7B,OAAO,IAAId,KAAK,CAACc,CAAC,CAAC;AACrB","names":["and","flatMap","foldEval","fold","implies","isSuccess","not","or","success","And","Not","Or","Value","right","left","f","self","fold_1","l","r","and_1","or_1","v","not_1","map","flatMap_1","a","success_1","failure","failures","tsplus_module_4","tsplus_module_1","tsplus_module_2","tsplus_module_3","cases","tsplus_module_5","_tag","value","tsplus_module_6","foldEval_1","result","iff","implies_1","isFailure"],"sourceRoot":"","sources":["../../../_src/data/FreeBooleanAlgebra/api.ts"],"sourcesContent":[null]}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
const fileName_1 = "(@fncts/test) src/data/TestAnnotation/api.ts";
|
1
2
|
import * as tsplus_module_1 from "@fncts/base/data/Tag/constructors";
|
2
3
|
import * as tsplus_module_2 from "@fncts/base/collection/immutable/HashSet/api";
|
3
4
|
import * as tsplus_module_3 from "@fncts/base/data/Either/constructors";
|
@@ -33,8 +34,8 @@ export const FibersTag = /*#__PURE__*/tsplus_module_1.makeTag("fncts.test.TestAn
|
|
33
34
|
/**
|
34
35
|
* @tsplus static fncts.test.TestAnnotationOps Fibers
|
35
36
|
*/
|
36
|
-
export const Fibers = /*#__PURE__*/new TestAnnotation(FibersTag, "fibers", /*#__PURE__*/tsplus_module_3.left(0), (left, right) => {
|
37
|
-
return tsplus_module_4.isLeft(left) ? tsplus_module_4.isLeft(right) ? tsplus_module_3.left(left.left + right.left) : right : tsplus_module_4.isRight(left) ? tsplus_module_4.isRight(right) ? tsplus_module_3.right(tsplus_module_5.concat(right.right)(left.right)) : right : (() => {
|
37
|
+
export const Fibers = /*#__PURE__*/new TestAnnotation(FibersTag, "fibers", /*#__PURE__*/tsplus_module_3.left(0, fileName_1 + ":39:74"), (left, right) => {
|
38
|
+
return tsplus_module_4.isLeft(left) ? tsplus_module_4.isLeft(right) ? tsplus_module_3.left(left.left + right.left, fileName_1 + ":42:20") : right : tsplus_module_4.isRight(left) ? tsplus_module_4.isRight(right) ? tsplus_module_3.right(tsplus_module_5.concat(right.right)(left.right), fileName_1 + ":46:21") : right : (() => {
|
38
39
|
throw new Error("absurd");
|
39
40
|
})();
|
40
41
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"api.mjs","mappings":"
|
1
|
+
{"version":3,"file":"api.mjs","mappings":";;;;;;AAAA,SAASA,cAAc,QAAQ,kBAAiB;AAEhD,OAAO,MAAMC,UAAU,gBAAGC,wBAAY,mCAAmC,CAAC;AAC1E;;;AAGA,OAAO,MAAMC,OAAO,gBAAG,IAAIH,cAAc,CAACC,UAAU,EAAE,SAAS,EAAE,CAAC,EAAE,CAACG,CAAC,EAAEC,CAAC,KAAKD,CAAC,GAAGC,CAAC,CAAC;AAEpF,OAAO,MAAMC,WAAW,gBAAGJ,wBAAY,oCAAoC,CAAC;AAC5E;;;AAGA,OAAO,MAAMK,QAAQ,gBAAG,IAAIP,cAAc,CAACM,WAAW,EAAE,UAAU,EAAE,CAAC,EAAE,CAACF,CAAC,EAAEC,CAAC,KAAKD,CAAC,GAAGC,CAAC,CAAC;AAEvF,OAAO,MAAMG,UAAU,gBAAGN,wBAAY,mCAAmC,CAAC;AAC1E;;;AAGA,OAAO,MAAMO,OAAO,gBAAG,IAAIT,cAAc,CAACQ,UAAU,EAAE,SAAS,EAAE,CAAC,EAAE,CAACJ,CAAC,EAAEC,CAAC,KAAKD,CAAC,GAAGC,CAAC,CAAC;AAEpF,OAAO,MAAMK,SAAS,gBAAGR,wBAAqB,kCAAkC,CAAC;AACjF;;;AAGA,OAAO,MAAMS,MAAM,gBAAG,IAAIX,cAAc,CAACU,SAAS,EAAE,QAAQ,eAAEE,uBAAe,EAAE,CAACR,CAAC,EAAEC,CAAC,KAAKO,sBAAQP,CAAC,EAATD,CAAC,CAAS,CAAC;AAEpG,OAAO,MAAMS,SAAS,gBAAGX,wBAAY,kCAAkC,CAAC;AACxE;;;AAGA,OAAO,MAAMY,MAAM,gBAAG,IAAId,cAAc,CAACa,SAAS,EAAE,QAAQ,EAAE,CAAC,EAAE,CAACT,CAAC,EAAEC,CAAC,KAAKD,CAAC,GAAGC,CAAC,CAAC;AAEjF,OAAO,MAAMU,SAAS,gBAAGb,wBACvB,kCAAkC,CACnC;AACD;;;AAGA,OAAO,MAAMc,MAAM,gBAAG,IAAIhB,cAAc,CAACe,SAAS,EAAE,QAAQ,eAAEE,qBAAY,CAAC,wBAAC,EAAE,CAACC,IAAI,EAAEC,KAAK,KAAI;EAC5F,OAAOC,2BAAI,CAAS,GAChBA,4BAAK,CAAS,GACZH,qBAAYC,IAAI,CAACA,IAAI,GAAGC,KAAK,CAACD,IAAI,wBAAC,GACnCC,KAAK,GACPC,4BAAI,CAAU,GACdA,6BAAK,CAAU,GACbH,sBAAaI,uBAAkBF,KAAK,CAACA,KAAK,EAA7BD,IAAI,CAACC,KAAK,CAAoB,wBAAC,GAC5CA,KAAK,GACP,CAAC,MAAK;IACJ,MAAM,IAAIG,KAAK,CAAC,QAAQ,CAAC;EAC3B,CAAC,GAAG;AACV,CAAC,CAAC","names":["TestAnnotation","IgnoredTag","tsplus_module_1","Ignored","x","y","RepeatedTag","Repeated","RetriedTag","Retried","TaggedTag","Tagged","tsplus_module_2","TimingTag","Timing","FibersTag","Fibers","tsplus_module_3","left","right","tsplus_module_4","tsplus_module_5","Error"],"sourceRoot":"","sources":["../../../_src/data/TestAnnotation/api.ts"],"sourcesContent":[null]}
|
package/_mjs/demo.mjs
CHANGED
@@ -28,5 +28,5 @@ class DemoSpec extends DefaultRunnableSpec {
|
|
28
28
|
})));
|
29
29
|
}
|
30
30
|
}
|
31
|
-
tsplus_module_3.
|
31
|
+
tsplus_module_3.unsafeRunFiber(new DemoSpec().run(fileName_1 + ":17:19"), fileName_1 + ":17:36");
|
32
32
|
//# sourceMappingURL=demo.mjs.map
|
package/_src/api.ts
CHANGED
@@ -59,7 +59,7 @@ export function assert<A>(assertion: Assertion<A>) {
|
|
59
59
|
}
|
60
60
|
|
61
61
|
/**
|
62
|
-
* @tsplus pipeable
|
62
|
+
* @tsplus pipeable global assert
|
63
63
|
*/
|
64
64
|
export function assertIO<A>(assertion: AssertionIO<A>) {
|
65
65
|
return <R, E>(io: IO<R, E, A>): IO<R, E, TestResult> => {
|
package/_src/control/Gen/api.ts
CHANGED
@@ -1,4 +1,11 @@
|
|
1
|
-
import type {
|
1
|
+
import type {
|
2
|
+
DateConstraints,
|
3
|
+
EqConstraint,
|
4
|
+
FloatConstraints,
|
5
|
+
LengthConstraints,
|
6
|
+
NumberConstraints,
|
7
|
+
ObjectConstraints,
|
8
|
+
} from "./constraints.js";
|
2
9
|
import type { _A, _R } from "@fncts/base/types.js";
|
3
10
|
import type { ArrayInt64 } from "@fncts/base/util/rand";
|
4
11
|
|
@@ -26,6 +33,89 @@ import { Gen } from "./definition.js";
|
|
26
33
|
|
27
34
|
const gapSize = 0xdfff + 1 - 0xd800;
|
28
35
|
|
36
|
+
/**
|
37
|
+
* @tsplus static fncts.test.GenOps anything
|
38
|
+
*/
|
39
|
+
export function anything<C extends ObjectConstraints>(
|
40
|
+
constraints: C = {} as C,
|
41
|
+
): Gen<
|
42
|
+
ObjectConstraints extends C
|
43
|
+
? Sized
|
44
|
+
: unknown extends C["key"]
|
45
|
+
? Sized
|
46
|
+
: _R<C["key"]> | C["values"] extends Array<infer A>
|
47
|
+
? _R<A>
|
48
|
+
: Sized,
|
49
|
+
unknown
|
50
|
+
> {
|
51
|
+
const key = constraints.key ?? Gen.alphaNumericString;
|
52
|
+
const maxDepth = constraints.maxDepth ?? 2;
|
53
|
+
const maxKeys = constraints.maxKeys ?? 5;
|
54
|
+
const values = constraints.values ?? [
|
55
|
+
Gen.boolean,
|
56
|
+
Gen.alphaNumericString,
|
57
|
+
Gen.double,
|
58
|
+
Gen.int,
|
59
|
+
Gen.oneOf(Gen.alphaNumericString, Gen.constant(null), Gen.constant(undefined)),
|
60
|
+
];
|
61
|
+
|
62
|
+
function mapOf<R, K, R1, V>(key: Gen<R, K>, value: Gen<R1, V>) {
|
63
|
+
return Gen.tuple(key, value)
|
64
|
+
.uniqueConc({
|
65
|
+
eq: Eq({
|
66
|
+
equals:
|
67
|
+
([k1]) =>
|
68
|
+
([k]) =>
|
69
|
+
Equatable.strictEquals(k, k1),
|
70
|
+
}),
|
71
|
+
maxLength: maxKeys,
|
72
|
+
})
|
73
|
+
.map((pairs) => new Map(pairs));
|
74
|
+
}
|
75
|
+
|
76
|
+
function setOf<R, V>(value: Gen<R, V>) {
|
77
|
+
return value
|
78
|
+
.uniqueConc({ eq: Eq({ equals: (v1) => (v) => Equatable.strictEquals(v, v1) }), maxLength: maxKeys })
|
79
|
+
.map((values) => new Set(values));
|
80
|
+
}
|
81
|
+
|
82
|
+
const base = Gen.oneOf(...values);
|
83
|
+
const arrayBase = Gen.oneOf(...values.map((gen) => gen.arrayWith({ maxLength: maxKeys })));
|
84
|
+
const arrayGen = Gen.memo((n) => Gen.oneOf(arrayBase, gen(n).arrayWith({ maxLength: maxKeys })));
|
85
|
+
const objectBase = Gen.oneOf(...values.map((gen) => Gen.record(key, gen)));
|
86
|
+
const objectGen = Gen.memo((n) => Gen.oneOf(objectBase, Gen.record(key, gen(n))));
|
87
|
+
const setBase = Gen.oneOf(...values.map(setOf));
|
88
|
+
const setGen = Gen.memo((n) => Gen.oneOf(setBase, setOf(gen(n))));
|
89
|
+
const mapBase = Gen.oneOf(...values.map((value) => mapOf(key, value)));
|
90
|
+
const mapGen = Gen.memo((n) => Gen.oneOf(mapBase, mapOf(Gen.oneOf(key, gen(n)), gen(n))));
|
91
|
+
|
92
|
+
const gen: (n: number) => Gen<any, any> = Gen.memo((n) => {
|
93
|
+
if (n <= 0) return base;
|
94
|
+
return Gen.oneOf(
|
95
|
+
base,
|
96
|
+
arrayGen(),
|
97
|
+
objectGen(),
|
98
|
+
...(constraints.withDate ? [Gen.date()] : []),
|
99
|
+
...(constraints.withSet ? [setGen()] : []),
|
100
|
+
...(constraints.withMap ? [mapGen()] : []),
|
101
|
+
...(constraints.withTypedArray
|
102
|
+
? [
|
103
|
+
Gen.oneOf(
|
104
|
+
Gen.int8Array(),
|
105
|
+
Gen.uint8Array(),
|
106
|
+
Gen.int16Array(),
|
107
|
+
Gen.uint16Array(),
|
108
|
+
Gen.int32Array(),
|
109
|
+
Gen.uint32Array(),
|
110
|
+
),
|
111
|
+
]
|
112
|
+
: []),
|
113
|
+
);
|
114
|
+
});
|
115
|
+
|
116
|
+
return gen(maxDepth);
|
117
|
+
}
|
118
|
+
|
29
119
|
/**
|
30
120
|
* @tsplus static fncts.test.GenOps size
|
31
121
|
*/
|
@@ -684,6 +774,81 @@ export function tuple<A extends [...Gen<any, any>[]]>(
|
|
684
774
|
) as any;
|
685
775
|
}
|
686
776
|
|
777
|
+
/**
|
778
|
+
* @tsplus static fncts.test.GenOps record
|
779
|
+
*/
|
780
|
+
export function record<R, R1, A>(
|
781
|
+
key: Gen<R, string>,
|
782
|
+
value: Gen<R1, A>,
|
783
|
+
constraints?: LengthConstraints,
|
784
|
+
): Gen<Sized | R | R1, Record<string, A>> {
|
785
|
+
return Gen.tuple(key, value)
|
786
|
+
.uniqueConc({ eq: String.Eq.contramap(([k]) => k), ...constraints })
|
787
|
+
.map((pairs) => pairs.foldLeft({} as Record<string, A>, (b, [k, v]) => ({ ...b, [k]: v })));
|
788
|
+
}
|
789
|
+
|
790
|
+
/**
|
791
|
+
* @tsplus static fncts.test.GenOps date
|
792
|
+
*/
|
793
|
+
export function date(constraints: DateConstraints = {}): Gen<never, Date> {
|
794
|
+
const min = constraints.min ? constraints.min.getTime() : -8_640_000_000_000_000;
|
795
|
+
const max = constraints.max ? constraints.max.getTime() : 8_640_000_000_000_000;
|
796
|
+
return Gen.intWith({ min, max }).map((n) => new Date(n));
|
797
|
+
}
|
798
|
+
|
799
|
+
function typedArray<A>(
|
800
|
+
constraints: LengthConstraints & NumberConstraints,
|
801
|
+
minBound: number,
|
802
|
+
maxBound: number,
|
803
|
+
ctor: { new (arg: ReadonlyArray<number>): A },
|
804
|
+
): Gen<Sized, A> {
|
805
|
+
const min = constraints.min ? clamp(constraints.min, minBound, maxBound) : minBound;
|
806
|
+
const max = constraints.max ? clamp(constraints.max, minBound, maxBound) : maxBound;
|
807
|
+
return Gen.array(Gen.intWith({ min, max })).map((n) => new ctor(n));
|
808
|
+
}
|
809
|
+
|
810
|
+
/**
|
811
|
+
* @tsplus static fncts.test.GenOps int8Array
|
812
|
+
*/
|
813
|
+
export function int8Array(constraints: LengthConstraints & NumberConstraints = {}): Gen<Sized, Int8Array> {
|
814
|
+
return typedArray(constraints, -128, 127, Int8Array);
|
815
|
+
}
|
816
|
+
|
817
|
+
/**
|
818
|
+
* @tsplus static fncts.test.GenOps int16Array
|
819
|
+
*/
|
820
|
+
export function int16Array(constraints: LengthConstraints & NumberConstraints = {}): Gen<Sized, Int16Array> {
|
821
|
+
return typedArray(constraints, -32768, 32767, Int16Array);
|
822
|
+
}
|
823
|
+
|
824
|
+
/**
|
825
|
+
* @tsplus static fncts.test.GenOps int32Array
|
826
|
+
*/
|
827
|
+
export function int32Array(constraints: LengthConstraints & NumberConstraints = {}): Gen<Sized, Int32Array> {
|
828
|
+
return typedArray(constraints, -0x80000000, 0x7fffffff, Int32Array);
|
829
|
+
}
|
830
|
+
|
831
|
+
/**
|
832
|
+
* @tsplus static fncts.test.GenOps uint8Array
|
833
|
+
*/
|
834
|
+
export function uint8Array(constraints: LengthConstraints & NumberConstraints = {}): Gen<Sized, Uint8Array> {
|
835
|
+
return typedArray(constraints, 0, 255, Uint8Array);
|
836
|
+
}
|
837
|
+
|
838
|
+
/**
|
839
|
+
* @tsplus static fncts.test.GenOps uint16Array
|
840
|
+
*/
|
841
|
+
export function uint16Array(constraints: LengthConstraints & NumberConstraints = {}): Gen<Sized, Uint16Array> {
|
842
|
+
return typedArray(constraints, 0, 65535, Uint16Array);
|
843
|
+
}
|
844
|
+
|
845
|
+
/**
|
846
|
+
* @tsplus static fncts.test.GenOps uint32Array
|
847
|
+
*/
|
848
|
+
export function uint32Array(constraints: LengthConstraints & NumberConstraints = {}): Gen<Sized, Uint32Array> {
|
849
|
+
return typedArray(constraints, 0, 0xffffffff, Uint32Array);
|
850
|
+
}
|
851
|
+
|
687
852
|
function _char(min: number, max: number, mapToCode: (v: number) => number): Gen<never, string> {
|
688
853
|
return Gen.intWith({ min, max }).map((n) => String.fromCharCode(mapToCode(n)));
|
689
854
|
}
|
@@ -21,23 +21,22 @@ export abstract class Live {
|
|
21
21
|
),
|
22
22
|
LiveTag,
|
23
23
|
);
|
24
|
-
static
|
24
|
+
static live<R extends Live, E, A>(io: IO<R, E, A>): IO<R | Live, E, A> {
|
25
25
|
return IO.serviceWithIO((live) => live.provide(io), LiveTag);
|
26
26
|
}
|
27
27
|
}
|
28
28
|
|
29
29
|
/**
|
30
|
-
* @tsplus static fncts.
|
30
|
+
* @tsplus static fncts.io.IOOps liveWith
|
31
31
|
*/
|
32
|
-
export function
|
33
|
-
|
34
|
-
f: (_: IO<never, E, A>) => IO<IOEnv, E1, B>,
|
35
|
-
): IO<Exclude<R, Live>, E | E1, B> {
|
36
|
-
// @ts-expect-error
|
37
|
-
return IO.environment<R | Live>().flatMap((r) => Live.Live(f(io.provideEnvironment(r))));
|
32
|
+
export function liveWith<R, E, A>(f: (live: Live) => IO<R, E, A>): IO<R | Live, E, A> {
|
33
|
+
return IO.environmentWithIO((environment) => f(environment.get(Live.Tag)));
|
38
34
|
}
|
39
35
|
|
36
|
+
/**
|
37
|
+
* @tsplus static fncts.test.LiveOps withLive
|
38
|
+
*/
|
40
39
|
export function withLive<R extends Live, E, A>(io: IO<R, E, A>) {
|
41
40
|
return <E1, B>(f: (_: IO<R, E, A>) => IO<R, E1, B>): IO<R | Live, E1, B> =>
|
42
|
-
IOEnv.services.getWith((services) => Live.
|
41
|
+
IOEnv.services.getWith((services) => Live.live(f(IOEnv.services.locally(services)(io))));
|
43
42
|
}
|
@@ -102,14 +102,14 @@ export function timeoutWarning(duration: Duration): TestAspect<Live, any> {
|
|
102
102
|
|
103
103
|
function warn<R, E>(labels: Vector<string>, test: IO<R, TestFailure<E>, TestSuccess>, duration: Duration) {
|
104
104
|
return test.raceWith(
|
105
|
-
Live.withLive(showWarning(labels, duration)
|
105
|
+
Live.withLive(showWarning(labels, duration))((io) => Clock.sleep(duration) > io),
|
106
106
|
(result, fiber) => fiber.interrupt > IO.fromExitNow(result),
|
107
107
|
(_, fiber) => fiber.join,
|
108
108
|
);
|
109
109
|
}
|
110
110
|
|
111
111
|
function showWarning(labels: Vector<string>, duration: Duration) {
|
112
|
-
return
|
112
|
+
return Console.print(renderWarning(labels, duration));
|
113
113
|
}
|
114
114
|
|
115
115
|
function renderWarning(labels: Vector<string>, duration: Duration) {
|
package/_src/demo.ts
CHANGED
package/api.d.ts
CHANGED
@@ -17,7 +17,7 @@ export declare function traverseResult<A>(value: A, assertResult: AssertResult<A
|
|
17
17
|
*/
|
18
18
|
export declare function assert<A>(assertion: Assertion<A>): (value: A) => TestResult;
|
19
19
|
/**
|
20
|
-
* @tsplus pipeable
|
20
|
+
* @tsplus pipeable global assert
|
21
21
|
* @tsplus location "@fncts/test/api"
|
22
22
|
*/
|
23
23
|
export declare function assertIO<A>(assertion: AssertionIO<A>): <R, E>(io: import("@fncts/io/IO.js").IO<R, E, A>) => import("@fncts/io/IO.js").IO<R, E, TestResult>;
|
package/control/Gen/api.d.ts
CHANGED
@@ -6,12 +6,17 @@ import { IO, URIO } from "@fncts/io/IO/definition";
|
|
6
6
|
import { Stream } from "@fncts/io/Stream/definition";
|
7
7
|
import { Maybe } from "@fncts/base/data/Maybe/definition";
|
8
8
|
import { Eq } from "@fncts/base/data/Eq/definition";
|
9
|
-
import type { EqConstraint, FloatConstraints, LengthConstraints, NumberConstraints } from "./constraints.js";
|
9
|
+
import type { DateConstraints, EqConstraint, FloatConstraints, LengthConstraints, NumberConstraints, ObjectConstraints } from "./constraints.js";
|
10
10
|
import type { _A, _R } from "@fncts/base/types.js";
|
11
11
|
import type { ArrayInt64 } from "@fncts/base/util/rand";
|
12
12
|
import { Sample } from "../Sample.js";
|
13
13
|
import { Sized } from "../Sized.js";
|
14
14
|
import { Gen } from "./definition.js";
|
15
|
+
/**
|
16
|
+
* @tsplus static fncts.test.GenOps anything
|
17
|
+
* @tsplus location "@fncts/test/control/Gen/api"
|
18
|
+
*/
|
19
|
+
export declare function anything<C extends ObjectConstraints>(constraints?: C): Gen<ObjectConstraints extends C ? Sized : unknown extends C["key"] ? Sized : _R<C["key"]> | C["values"] extends Array<infer A> ? _R<A> : Sized, unknown>;
|
15
20
|
/**
|
16
21
|
* @tsplus static fncts.test.GenOps size
|
17
22
|
* @tsplus location "@fncts/test/control/Gen/api"
|
@@ -373,3 +378,43 @@ export declare function tuple<A extends [...Gen<any, any>[]]>(...components: A):
|
|
373
378
|
}[keyof A & number], {
|
374
379
|
[K in keyof A]: [A[K]] extends [Gen<any, infer A>] ? A : never;
|
375
380
|
}>;
|
381
|
+
/**
|
382
|
+
* @tsplus static fncts.test.GenOps record
|
383
|
+
* @tsplus location "@fncts/test/control/Gen/api"
|
384
|
+
*/
|
385
|
+
export declare function record<R, R1, A>(key: Gen<R, string>, value: Gen<R1, A>, constraints?: LengthConstraints): Gen<Sized | R | R1, Record<string, A>>;
|
386
|
+
/**
|
387
|
+
* @tsplus static fncts.test.GenOps date
|
388
|
+
* @tsplus location "@fncts/test/control/Gen/api"
|
389
|
+
*/
|
390
|
+
export declare function date(constraints?: DateConstraints): Gen<never, Date>;
|
391
|
+
/**
|
392
|
+
* @tsplus static fncts.test.GenOps int8Array
|
393
|
+
* @tsplus location "@fncts/test/control/Gen/api"
|
394
|
+
*/
|
395
|
+
export declare function int8Array(constraints?: LengthConstraints & NumberConstraints): Gen<Sized, Int8Array>;
|
396
|
+
/**
|
397
|
+
* @tsplus static fncts.test.GenOps int16Array
|
398
|
+
* @tsplus location "@fncts/test/control/Gen/api"
|
399
|
+
*/
|
400
|
+
export declare function int16Array(constraints?: LengthConstraints & NumberConstraints): Gen<Sized, Int16Array>;
|
401
|
+
/**
|
402
|
+
* @tsplus static fncts.test.GenOps int32Array
|
403
|
+
* @tsplus location "@fncts/test/control/Gen/api"
|
404
|
+
*/
|
405
|
+
export declare function int32Array(constraints?: LengthConstraints & NumberConstraints): Gen<Sized, Int32Array>;
|
406
|
+
/**
|
407
|
+
* @tsplus static fncts.test.GenOps uint8Array
|
408
|
+
* @tsplus location "@fncts/test/control/Gen/api"
|
409
|
+
*/
|
410
|
+
export declare function uint8Array(constraints?: LengthConstraints & NumberConstraints): Gen<Sized, Uint8Array>;
|
411
|
+
/**
|
412
|
+
* @tsplus static fncts.test.GenOps uint16Array
|
413
|
+
* @tsplus location "@fncts/test/control/Gen/api"
|
414
|
+
*/
|
415
|
+
export declare function uint16Array(constraints?: LengthConstraints & NumberConstraints): Gen<Sized, Uint16Array>;
|
416
|
+
/**
|
417
|
+
* @tsplus static fncts.test.GenOps uint32Array
|
418
|
+
* @tsplus location "@fncts/test/control/Gen/api"
|
419
|
+
*/
|
420
|
+
export declare function uint32Array(constraints?: LengthConstraints & NumberConstraints): Gen<Sized, Uint32Array>;
|
@@ -12,11 +12,15 @@ export declare const LiveTag: import("@fncts/base/data/Tag").Tag<Live>;
|
|
12
12
|
export declare abstract class Live {
|
13
13
|
abstract provide<R, E, A>(io: IO<R, E, A>): IO<R, E, A>;
|
14
14
|
static Default: Layer<IOEnv, never, Live>;
|
15
|
-
static
|
15
|
+
static live<R extends Live, E, A>(io: IO<R, E, A>): IO<R | Live, E, A>;
|
16
16
|
}
|
17
|
+
/**
|
18
|
+
* @tsplus static fncts.io.IOOps liveWith
|
19
|
+
* @tsplus location "@fncts/test/control/Live/definition"
|
20
|
+
*/
|
21
|
+
export declare function liveWith<R, E, A>(f: (live: Live) => IO<R, E, A>): IO<R | Live, E, A>;
|
17
22
|
/**
|
18
23
|
* @tsplus static fncts.test.LiveOps withLive
|
19
24
|
* @tsplus location "@fncts/test/control/Live/definition"
|
20
25
|
*/
|
21
|
-
export declare function withLive_<R, E, A, E1, B>(io: IO<R, E, A>, f: (_: IO<never, E, A>) => IO<IOEnv, E1, B>): IO<Exclude<R, Live>, E | E1, B>;
|
22
26
|
export declare function withLive<R extends Live, E, A>(io: IO<R, E, A>): <E1, B>(f: (_: IO<R, E, A>) => import("@fncts/io/IO").IO<R, E1, B>) => import("@fncts/io/IO").IO<Live | R, E1, B>;
|
package/package.json
CHANGED