@fncts/test 0.0.12 → 0.0.15
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/TestSpec.d.ts +1 -1
- package/_cjs/api.cjs +9 -9
- package/_cjs/api.cjs.map +1 -1
- package/_cjs/control/Annotations/api.cjs +1 -1
- package/_cjs/control/Annotations/api.cjs.map +1 -1
- package/_cjs/control/Annotations/live.cjs +4 -4
- package/_cjs/control/Annotations/live.cjs.map +1 -1
- package/_cjs/control/Assertion/api.cjs +2 -0
- package/_cjs/control/Assertion/api.cjs.map +1 -1
- package/_cjs/control/AssertionIO/api.cjs +2 -0
- package/_cjs/control/AssertionIO/api.cjs.map +1 -1
- package/_cjs/control/DefaultTestReporter/render.cjs +2 -0
- package/_cjs/control/DefaultTestReporter/render.cjs.map +1 -1
- package/_cjs/control/FreeBooleanAlgebraIO/api.cjs +2 -2
- package/_cjs/control/FreeBooleanAlgebraIO/api.cjs.map +1 -1
- package/_cjs/control/Gen/api/char.cjs.map +1 -1
- package/_cjs/control/Gen/api/conc.cjs +4 -3
- package/_cjs/control/Gen/api/conc.cjs.map +1 -1
- package/_cjs/control/Gen/api/double.cjs +4 -4
- package/_cjs/control/Gen/api/double.cjs.map +1 -1
- package/_cjs/control/Gen/api/float.cjs +1 -1
- package/_cjs/control/Gen/api/float.cjs.map +1 -1
- package/_cjs/control/Gen/api/struct.cjs +1 -1
- package/_cjs/control/Gen/api/struct.cjs.map +1 -1
- package/_cjs/control/Gen/api.cjs +11 -11
- package/_cjs/control/Gen/api.cjs.map +1 -1
- package/_cjs/control/Gen/definition.cjs.map +1 -1
- package/_cjs/control/Live/definition.cjs +4 -4
- package/_cjs/control/Live/definition.cjs.map +1 -1
- package/_cjs/control/RunnableSpec.cjs +10 -12
- package/_cjs/control/RunnableSpec.cjs.map +1 -1
- package/_cjs/control/Sample/api.cjs +17 -17
- package/_cjs/control/Sample/api.cjs.map +1 -1
- package/_cjs/control/Sized/api.cjs +1 -1
- package/_cjs/control/Sized/api.cjs.map +1 -1
- package/_cjs/control/Sized/live.cjs +3 -3
- package/_cjs/control/Sized/live.cjs.map +1 -1
- package/_cjs/control/Spec/api.cjs +7 -7
- package/_cjs/control/Spec/api.cjs.map +1 -1
- package/_cjs/control/Spec/definition.cjs.map +1 -1
- package/_cjs/control/TestAspect/api.cjs +7 -7
- package/_cjs/control/TestAspect/api.cjs.map +1 -1
- package/_cjs/control/TestClock/api.cjs +14 -22
- package/_cjs/control/TestClock/api.cjs.map +1 -1
- package/_cjs/control/TestClock/definition.cjs +16 -16
- package/_cjs/control/TestClock/definition.cjs.map +1 -1
- package/_cjs/control/TestConsole/api.cjs +12 -15
- package/_cjs/control/TestConsole/api.cjs.map +1 -1
- package/_cjs/control/TestConsole/definition.cjs +11 -11
- package/_cjs/control/TestConsole/definition.cjs.map +1 -1
- package/_cjs/control/TestEnvironment.cjs +3 -2
- package/_cjs/control/TestEnvironment.cjs.map +1 -1
- package/_cjs/control/TestExecutor.cjs +6 -6
- package/_cjs/control/TestExecutor.cjs.map +1 -1
- package/_cjs/control/TestLogger.cjs +1 -1
- package/_cjs/control/TestLogger.cjs.map +1 -1
- package/_cjs/control/TestRandom/api.cjs +10 -18
- package/_cjs/control/TestRandom/api.cjs.map +1 -1
- package/_cjs/control/TestRandom/definition.cjs +17 -17
- package/_cjs/control/TestRandom/definition.cjs.map +1 -1
- package/_cjs/control/TestRunner.cjs +1 -1
- package/_cjs/control/TestRunner.cjs.map +1 -1
- package/_cjs/control.cjs +6 -0
- package/_cjs/control.cjs.map +1 -0
- package/_cjs/data/LogLine/Line.cjs +2 -0
- package/_cjs/data/LogLine/Line.cjs.map +1 -1
- package/_cjs/data/LogLine/Message.cjs +4 -3
- package/_cjs/data/LogLine/Message.cjs.map +1 -1
- package/_cjs/data/TestConfig.cjs +7 -5
- package/_cjs/data/TestConfig.cjs.map +1 -1
- package/_cjs/data.cjs +6 -0
- package/_cjs/data.cjs.map +1 -0
- package/_cjs/global.cjs +6 -0
- package/_cjs/global.cjs.map +1 -0
- package/_cjs/index.cjs +6 -0
- package/_cjs/index.cjs.map +1 -0
- package/_cjs/util/math.cjs +3 -3
- package/_cjs/util/math.cjs.map +1 -1
- package/_cjs/util.cjs +6 -0
- package/_cjs/util.cjs.map +1 -0
- package/_mjs/api.mjs +9 -9
- package/_mjs/api.mjs.map +1 -1
- package/_mjs/control/Annotations/api.mjs +1 -1
- package/_mjs/control/Annotations/api.mjs.map +1 -1
- package/_mjs/control/Annotations/live.mjs +4 -4
- package/_mjs/control/Annotations/live.mjs.map +1 -1
- package/_mjs/control/Assertion/api.mjs +1 -0
- package/_mjs/control/Assertion/api.mjs.map +1 -1
- package/_mjs/control/AssertionIO/api.mjs +1 -0
- package/_mjs/control/AssertionIO/api.mjs.map +1 -1
- package/_mjs/control/DefaultTestReporter/render.mjs +1 -0
- package/_mjs/control/DefaultTestReporter/render.mjs.map +1 -1
- package/_mjs/control/FreeBooleanAlgebraIO/api.mjs +2 -2
- package/_mjs/control/FreeBooleanAlgebraIO/api.mjs.map +1 -1
- package/_mjs/control/Gen/api/char.mjs.map +1 -1
- package/_mjs/control/Gen/api/conc.mjs +1 -0
- package/_mjs/control/Gen/api/conc.mjs.map +1 -1
- package/_mjs/control/Gen/api/double.mjs +4 -4
- package/_mjs/control/Gen/api/double.mjs.map +1 -1
- package/_mjs/control/Gen/api/float.mjs +1 -1
- package/_mjs/control/Gen/api/float.mjs.map +1 -1
- package/_mjs/control/Gen/api/struct.mjs +1 -1
- package/_mjs/control/Gen/api/struct.mjs.map +1 -1
- package/_mjs/control/Gen/api.mjs +11 -11
- package/_mjs/control/Gen/api.mjs.map +1 -1
- package/_mjs/control/Gen/definition.mjs.map +1 -1
- package/_mjs/control/Live/definition.mjs +4 -4
- package/_mjs/control/Live/definition.mjs.map +1 -1
- package/_mjs/control/RunnableSpec.mjs +10 -12
- package/_mjs/control/RunnableSpec.mjs.map +1 -1
- package/_mjs/control/Sample/api.mjs +15 -15
- package/_mjs/control/Sample/api.mjs.map +1 -1
- package/_mjs/control/Sized/api.mjs +1 -1
- package/_mjs/control/Sized/api.mjs.map +1 -1
- package/_mjs/control/Sized/live.mjs +3 -3
- package/_mjs/control/Sized/live.mjs.map +1 -1
- package/_mjs/control/Spec/api.mjs +7 -7
- package/_mjs/control/Spec/api.mjs.map +1 -1
- package/_mjs/control/Spec/definition.mjs.map +1 -1
- package/_mjs/control/TestAspect/api.mjs +7 -7
- package/_mjs/control/TestAspect/api.mjs.map +1 -1
- package/_mjs/control/TestClock/api.mjs +13 -21
- package/_mjs/control/TestClock/api.mjs.map +1 -1
- package/_mjs/control/TestClock/definition.mjs +16 -16
- package/_mjs/control/TestClock/definition.mjs.map +1 -1
- package/_mjs/control/TestConsole/api.mjs +10 -13
- package/_mjs/control/TestConsole/api.mjs.map +1 -1
- package/_mjs/control/TestConsole/definition.mjs +11 -11
- package/_mjs/control/TestConsole/definition.mjs.map +1 -1
- package/_mjs/control/TestEnvironment.mjs +3 -2
- package/_mjs/control/TestEnvironment.mjs.map +1 -1
- package/_mjs/control/TestExecutor.mjs +6 -6
- package/_mjs/control/TestExecutor.mjs.map +1 -1
- package/_mjs/control/TestLogger.mjs +1 -1
- package/_mjs/control/TestLogger.mjs.map +1 -1
- package/_mjs/control/TestRandom/api.mjs +10 -18
- package/_mjs/control/TestRandom/api.mjs.map +1 -1
- package/_mjs/control/TestRandom/definition.mjs +17 -17
- package/_mjs/control/TestRandom/definition.mjs.map +1 -1
- package/_mjs/control/TestRunner.mjs +1 -1
- package/_mjs/control/TestRunner.mjs.map +1 -1
- package/_mjs/control.mjs +2 -0
- package/_mjs/control.mjs.map +1 -0
- package/_mjs/data/LogLine/Line.mjs +1 -0
- package/_mjs/data/LogLine/Line.mjs.map +1 -1
- package/_mjs/data/LogLine/Message.mjs +1 -0
- package/_mjs/data/LogLine/Message.mjs.map +1 -1
- package/_mjs/data/TestConfig.mjs +6 -5
- package/_mjs/data/TestConfig.mjs.map +1 -1
- package/_mjs/data.mjs +2 -0
- package/_mjs/data.mjs.map +1 -0
- package/_mjs/global.mjs +2 -0
- package/_mjs/global.mjs.map +1 -0
- package/_mjs/index.mjs +2 -0
- package/_mjs/index.mjs.map +1 -0
- package/_mjs/util/math.mjs +3 -3
- package/_mjs/util/math.mjs.map +1 -1
- package/_mjs/util.mjs +2 -0
- package/_mjs/util.mjs.map +1 -0
- package/_src/api.ts +9 -9
- package/_src/control/AbstractRunnableSpec.ts +2 -2
- package/_src/control/Annotations/api.ts +4 -4
- package/_src/control/AssertionIO/definition.ts +1 -1
- package/_src/control/DefaultTestReporter/render.ts +1 -1
- package/_src/control/FreeBooleanAlgebraIO/api.ts +4 -4
- package/_src/control/Gen/api/array.ts +2 -2
- package/_src/control/Gen/api/char.ts +10 -10
- package/_src/control/Gen/api/conc.ts +2 -2
- package/_src/control/Gen/api/double.ts +2 -2
- package/_src/control/Gen/api/float.ts +1 -1
- package/_src/control/Gen/api/string.ts +8 -8
- package/_src/control/Gen/api.ts +20 -20
- package/_src/control/Gen/definition.ts +2 -0
- package/_src/control/Live/definition.ts +7 -7
- package/_src/control/RunnableSpec.ts +4 -4
- package/_src/control/Sample/api.ts +12 -12
- package/_src/control/Sized/api.ts +2 -2
- package/_src/control/Sized/live.ts +1 -1
- package/_src/control/Spec/api.ts +21 -24
- package/_src/control/Spec/definition.ts +3 -3
- package/_src/control/TestAspect/api.ts +12 -14
- package/_src/control/TestAspect/definition.ts +1 -1
- package/_src/control/TestClock/api.ts +10 -10
- package/_src/control/TestClock/definition.ts +3 -3
- package/_src/control/TestConsole/api.ts +5 -5
- package/_src/control/TestEnvironment.ts +11 -10
- package/_src/control/TestExecutor.ts +4 -6
- package/_src/control/TestLogger.ts +2 -2
- package/_src/control/TestRandom/api.ts +10 -10
- package/_src/control/TestRunner.ts +3 -3
- package/_src/control.ts +26 -0
- package/_src/data/TestConfig.ts +1 -1
- package/_src/data.ts +21 -0
- package/_src/global.ts +8 -0
- package/_src/index.ts +8 -0
- package/_src/util/math.ts +3 -3
- package/_src/util.ts +3 -0
- package/api.d.ts +7 -8
- package/control/AbstractRunnableSpec.d.ts +3 -4
- package/control/Annotations/api.d.ts +7 -8
- package/control/Annotations/definition.d.ts +3 -3
- package/control/Annotations/live.d.ts +8 -8
- package/control/Assertion/api.d.ts +2 -2
- package/control/Assertion/definition.d.ts +1 -1
- package/control/AssertionIO/definition.d.ts +1 -1
- package/control/DefaultRunnableSpec.d.ts +2 -2
- package/control/DefaultTestReporter/render.d.ts +5 -6
- package/control/FreeBooleanAlgebraIO/api.d.ts +5 -5
- package/control/FreeBooleanAlgebraIO/definition.d.ts +1 -1
- package/control/Gen/api/array.d.ts +2 -3
- package/control/Gen/api/char.d.ts +9 -9
- package/control/Gen/api/conc.d.ts +2 -3
- package/control/Gen/api/double.d.ts +2 -2
- package/control/Gen/api/float.d.ts +1 -1
- package/control/Gen/api/string.d.ts +8 -9
- package/control/Gen/api.d.ts +22 -23
- package/control/Gen/definition.d.ts +4 -2
- package/control/Live/definition.d.ts +5 -7
- package/control/RunnableSpec.d.ts +2 -3
- package/control/Sample/api.d.ts +13 -13
- package/control/Sample/definition.d.ts +2 -2
- package/control/Sized/api.d.ts +3 -4
- package/control/Sized/definition.d.ts +1 -1
- package/control/Sized/live.d.ts +2 -3
- package/control/Spec/api.d.ts +17 -19
- package/control/Spec/definition.d.ts +6 -7
- package/control/Test.d.ts +1 -1
- package/control/TestAnnotationRenderer/definition.d.ts +2 -2
- package/control/TestAspect/api.d.ts +9 -10
- package/control/TestAspect/definition.d.ts +1 -1
- package/control/TestClock/api.d.ts +4 -5
- package/control/TestClock/definition.d.ts +12 -12
- package/control/TestConsole/api.d.ts +2 -3
- package/control/TestConsole/definition.d.ts +7 -7
- package/control/TestEnvironment.d.ts +4 -5
- package/control/TestExecutor.d.ts +3 -4
- package/control/TestLogger.d.ts +3 -4
- package/control/TestRandom/api.d.ts +10 -10
- package/control/TestRandom/definition.d.ts +5 -5
- package/control/TestRenderer/ConsoleRenderer.d.ts +1 -1
- package/control/TestRunner.d.ts +5 -6
- package/control.d.ts +24 -0
- package/data/AssertionResult.d.ts +1 -1
- package/data/AssertionValue/api.d.ts +1 -1
- package/data/AssertionValue/definition.d.ts +1 -1
- package/data/ExecutionResult.d.ts +1 -1
- package/data/FailureDetails.d.ts +2 -2
- package/data/FreeBooleanAlgebra/api.d.ts +2 -2
- package/data/TestAnnotation/api.d.ts +2 -2
- package/data/TestAnnotation/definition.d.ts +3 -2
- package/data/TestAnnotationMap.d.ts +1 -1
- package/data/TestArgs/definition.d.ts +1 -1
- package/data/TestConfig.d.ts +5 -6
- package/data/TestFailure.d.ts +1 -1
- package/data.d.ts +19 -0
- package/global.d.ts +9 -0
- package/index.d.ts +6 -0
- package/package.json +8 -4
- package/util/math.d.ts +4 -4
- package/util.d.ts +1 -0
|
@@ -114,7 +114,7 @@ export class TestClock extends Clock {
|
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
private get freeze(): IO<
|
|
117
|
+
private get freeze(): IO<never, void, HashMap<FiberId, FiberStatus>> {
|
|
118
118
|
return this.supervizedFibers.flatMap((fibers) =>
|
|
119
119
|
IO.foldLeft(fibers, HashMap.makeDefault<FiberId, FiberStatus>(), (map, fiber) =>
|
|
120
120
|
fiber.status.flatMap((status) => {
|
|
@@ -166,7 +166,7 @@ export class TestClock extends Clock {
|
|
|
166
166
|
);
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
private get suspended(): IO<
|
|
169
|
+
private get suspended(): IO<never, void, HashMap<FiberId, FiberStatus>> {
|
|
170
170
|
return this.freeze.zip(this.delay > this.freeze).flatMap(([first, last]) => {
|
|
171
171
|
if (Equatable.strictEquals(first, last)) {
|
|
172
172
|
return IO.succeedNow(first);
|
|
@@ -190,7 +190,7 @@ export class TestClock extends Clock {
|
|
|
190
190
|
Start: () =>
|
|
191
191
|
Just(this.live.provide(Clock.sleep((5).seconds) > Console.print(warning)).interruptible.fork.map(Pending)),
|
|
192
192
|
},
|
|
193
|
-
() => Nothing<IO<
|
|
193
|
+
() => Nothing<IO<never, never, WarningData>>(),
|
|
194
194
|
),
|
|
195
195
|
);
|
|
196
196
|
}
|
|
@@ -7,15 +7,15 @@ import { TestConsole } from "@fncts/test/control/TestConsole/definition";
|
|
|
7
7
|
/**
|
|
8
8
|
* @tsplus static fncts.test.TestConsoleOps make
|
|
9
9
|
*/
|
|
10
|
-
export function make(data: ConsoleData, debug = true): Layer<
|
|
10
|
+
export function make(data: ConsoleData, debug = true): Layer<Live, never, TestConsole> {
|
|
11
11
|
return Layer.scopedEnvironment(
|
|
12
12
|
IO.serviceWithIO(
|
|
13
13
|
(live) =>
|
|
14
|
-
|
|
15
|
-
const ref =
|
|
16
|
-
const debugRef =
|
|
14
|
+
Do((_) => {
|
|
15
|
+
const ref = _(Ref.make(data));
|
|
16
|
+
const debugRef = _(FiberRef.make(debug));
|
|
17
17
|
const test = new TestConsole(ref, live, debugRef);
|
|
18
|
-
|
|
18
|
+
_(IOEnv.services.locallyScopedWith((_) => _.add(test, Console.Tag)));
|
|
19
19
|
return Environment.empty.add(test, TestConsole.Tag);
|
|
20
20
|
}),
|
|
21
21
|
Live.Tag,
|
|
@@ -9,16 +9,17 @@ import { TestConsole } from "@fncts/test/control/TestConsole";
|
|
|
9
9
|
import { TestRandom } from "@fncts/test/control/TestRandom";
|
|
10
10
|
import { TestConfig } from "@fncts/test/data/TestConfig";
|
|
11
11
|
|
|
12
|
-
export type TestEnvironment =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
export type TestEnvironment =
|
|
13
|
+
| Annotations
|
|
14
|
+
| Live
|
|
15
|
+
| Sized
|
|
16
|
+
| TestClock
|
|
17
|
+
| TestConfig
|
|
18
|
+
| TestRandom
|
|
19
|
+
| Clock
|
|
20
|
+
| Random
|
|
21
|
+
| Console
|
|
22
|
+
| TestConsole;
|
|
22
23
|
|
|
23
24
|
export const LiveTestEnvironment: Layer<IOEnv, never, TestEnvironment> = Annotations.Live.and(Live.Default)
|
|
24
25
|
.and(Sized.Live(100))
|
|
@@ -11,15 +11,13 @@ import { TestAnnotationMap } from "../data/TestAnnotationMap.js";
|
|
|
11
11
|
import { RuntimeFailure } from "../data/TestFailure.js";
|
|
12
12
|
|
|
13
13
|
export interface TestExecutor<R> {
|
|
14
|
-
readonly run: <E>(spec: Spec<R
|
|
14
|
+
readonly run: <E>(spec: Spec<R | Annotations, E>, defExec: ExecutionStrategy) => UIO<ExecutedSpec<E>>;
|
|
15
15
|
readonly environment: Layer<unknown, never, R>;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
export function defaultTestExecutor<R>(
|
|
19
|
-
env: Layer<unknown, never, R & Has<Annotations>>,
|
|
20
|
-
): TestExecutor<R & Has<Annotations>> {
|
|
18
|
+
export function defaultTestExecutor<R>(env: Layer<never, never, R | Annotations>): TestExecutor<R | Annotations> {
|
|
21
19
|
return {
|
|
22
|
-
run: <E>(spec: Spec<R
|
|
20
|
+
run: <E>(spec: Spec<R | Annotations, E>, defExec: ExecutionStrategy): UIO<ExecutedSpec<E>> =>
|
|
23
21
|
spec.annotated
|
|
24
22
|
.provideLayer(env)
|
|
25
23
|
.foreachExec(
|
|
@@ -35,7 +33,7 @@ export function defaultTestExecutor<R>(
|
|
|
35
33
|
.scoped.flatMap(
|
|
36
34
|
(s) =>
|
|
37
35
|
s.foldScoped(
|
|
38
|
-
(spec: SpecCase<
|
|
36
|
+
(spec: SpecCase<never, never, Annotated<Either<TestFailure<E>, TestSuccess>>, ExecutedSpec<E>>) =>
|
|
39
37
|
matchTag_(spec, {
|
|
40
38
|
Exec: ({ spec }) => IO.succeedNow(spec),
|
|
41
39
|
Labeled: ({ label, spec }) => IO.succeedNow(ExecutedSpec.labeled(spec, label)),
|
|
@@ -16,7 +16,7 @@ export const TestLoggerTag = Tag<TestLogger>();
|
|
|
16
16
|
/**
|
|
17
17
|
* @tsplus static fncts.test.TestLoggerOps fromConsole
|
|
18
18
|
*/
|
|
19
|
-
export const fromConsole: Layer<
|
|
19
|
+
export const fromConsole: Layer<never, never, TestLogger> = Layer.fromIO(
|
|
20
20
|
IO.consoleWith((console) =>
|
|
21
21
|
IO.succeedNow(
|
|
22
22
|
new (class extends TestLogger {
|
|
@@ -32,6 +32,6 @@ export const fromConsole: Layer<unknown, never, Has<TestLogger>> = Layer.fromIO(
|
|
|
32
32
|
/**
|
|
33
33
|
* @tsplus static fncts.test.TestLoggerOps logLine
|
|
34
34
|
*/
|
|
35
|
-
export function logLine(line: string): URIO<
|
|
35
|
+
export function logLine(line: string): URIO<TestLogger, void> {
|
|
36
36
|
return IO.serviceWithIO((testLogger) => testLogger.logLine(line), TestLogger.Tag);
|
|
37
37
|
}
|
|
@@ -41,11 +41,11 @@ export function feedBooleans(...booleans: ReadonlyArray<boolean>) {
|
|
|
41
41
|
/**
|
|
42
42
|
* @tsplus static fncts.test.TestRandomOps make
|
|
43
43
|
*/
|
|
44
|
-
export function make(initialData: Data): Layer<
|
|
44
|
+
export function make(initialData: Data): Layer<never, never, Random | TestRandom> {
|
|
45
45
|
return Layer.fromIOEnvironment(
|
|
46
|
-
|
|
47
|
-
const data =
|
|
48
|
-
const buffer =
|
|
46
|
+
Do((_) => {
|
|
47
|
+
const data = _(Ref.make(initialData));
|
|
48
|
+
const buffer = _(Ref.make(new Buffer()));
|
|
49
49
|
const test = new TestRandom(data, buffer);
|
|
50
50
|
return Environment().add(test, TestRandom.Tag).add(test, Random.Tag);
|
|
51
51
|
}),
|
|
@@ -62,13 +62,13 @@ export const determinictic = TestRandom.make(defaultData);
|
|
|
62
62
|
/**
|
|
63
63
|
* @tsplus static fncts.test.TestRandomOps Random
|
|
64
64
|
*/
|
|
65
|
-
export const random: Layer<unknown, never,
|
|
65
|
+
export const random: Layer<unknown, never, TestRandom> = determinictic.to(
|
|
66
66
|
Layer.scoped(
|
|
67
|
-
|
|
68
|
-
const testRandom =
|
|
69
|
-
const time =
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
Do((_) => {
|
|
68
|
+
const testRandom = _(IO.service(TestRandom.Tag));
|
|
69
|
+
const time = _(Clock.currentTime);
|
|
70
|
+
_(testRandom.setSeed(time));
|
|
71
|
+
_(IOEnv.services.locallyScopedWith((_) => _.add(testRandom, Random.Tag)));
|
|
72
72
|
return testRandom;
|
|
73
73
|
}),
|
|
74
74
|
TestRandom.Tag,
|
|
@@ -14,18 +14,18 @@ import { ConsoleRenderer } from "@fncts/test/control/TestRenderer/ConsoleRendere
|
|
|
14
14
|
|
|
15
15
|
export class TestRunner<R, E> {
|
|
16
16
|
readonly reporter: TestReporter<E>;
|
|
17
|
-
readonly bootstrap: Layer<
|
|
17
|
+
readonly bootstrap: Layer<never, never, TestLogger>;
|
|
18
18
|
constructor(
|
|
19
19
|
readonly executor: TestExecutor<R>,
|
|
20
20
|
readonly runtimeConfig: RuntimeConfig = defaultRuntimeConfig,
|
|
21
21
|
reporter?: TestReporter<E>,
|
|
22
|
-
bootstrap?: Layer<
|
|
22
|
+
bootstrap?: Layer<never, never, TestLogger>,
|
|
23
23
|
) {
|
|
24
24
|
this.reporter = reporter ?? DefaultTestReporter.report(ConsoleRenderer.render, TestAnnotationRenderer.Default);
|
|
25
25
|
this.bootstrap = bootstrap ?? TestLogger.fromConsole;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
run(spec: Spec<R
|
|
28
|
+
run(spec: Spec<R | Annotations, E>): URIO<TestLogger, ExecutedSpec<E>> {
|
|
29
29
|
return this.executor
|
|
30
30
|
.run(spec, ExecutionStrategy.concurrentBounded(10))
|
|
31
31
|
.timedWith(Clock.currentTime)
|
package/_src/control.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// codegen:start { preset: type-barrel, include: ./control/*.ts }
|
|
2
|
+
export type {} from "./control/AbstractRunnableSpec.js";
|
|
3
|
+
export type {} from "./control/Annotations.js";
|
|
4
|
+
export type {} from "./control/Assertion.js";
|
|
5
|
+
export type {} from "./control/AssertionIO.js";
|
|
6
|
+
export type {} from "./control/DefaultRunnableSpec.js";
|
|
7
|
+
export type {} from "./control/DefaultTestReporter.js";
|
|
8
|
+
export type {} from "./control/FreeBooleanAlgebraIO.js";
|
|
9
|
+
export type {} from "./control/Gen.js";
|
|
10
|
+
export type {} from "./control/Live.js";
|
|
11
|
+
export type {} from "./control/RunnableSpec.js";
|
|
12
|
+
export type {} from "./control/Sample.js";
|
|
13
|
+
export type {} from "./control/Sized.js";
|
|
14
|
+
export type {} from "./control/Spec.js";
|
|
15
|
+
export type {} from "./control/SummaryBuilder.js";
|
|
16
|
+
export type {} from "./control/Test.js";
|
|
17
|
+
export type {} from "./control/TestAnnotationRenderer.js";
|
|
18
|
+
export type {} from "./control/TestAspect.js";
|
|
19
|
+
export type {} from "./control/TestClock.js";
|
|
20
|
+
export type {} from "./control/TestConsole.js";
|
|
21
|
+
export type {} from "./control/TestEnvironment.js";
|
|
22
|
+
export type {} from "./control/TestExecutor.js";
|
|
23
|
+
export type {} from "./control/TestLogger.js";
|
|
24
|
+
export type {} from "./control/TestRandom.js";
|
|
25
|
+
export type {} from "./control/TestRunner.js";
|
|
26
|
+
// codegen:end
|
package/_src/data/TestConfig.ts
CHANGED
|
@@ -17,7 +17,7 @@ export const TestConfigTag = Tag<TestConfig>();
|
|
|
17
17
|
/**
|
|
18
18
|
* @tsplus static fncts.test.data.TestConfigOps Live
|
|
19
19
|
*/
|
|
20
|
-
export function live(_: TestConfig): Layer<
|
|
20
|
+
export function live(_: TestConfig): Layer<never, never, TestConfig> {
|
|
21
21
|
return Layer.succeed(
|
|
22
22
|
new (class extends TestConfig {
|
|
23
23
|
repeats = _.repeats;
|
package/_src/data.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// codegen:start { preset: type-barrel, include: ./data/*.ts }
|
|
2
|
+
export type {} from "./data/AssertionData.js";
|
|
3
|
+
export type {} from "./data/AssertionResult.js";
|
|
4
|
+
export type {} from "./data/AssertionValue.js";
|
|
5
|
+
export type {} from "./data/ExecutedSpec.js";
|
|
6
|
+
export type {} from "./data/ExecutionResult.js";
|
|
7
|
+
export type {} from "./data/FailureDetails.js";
|
|
8
|
+
export type {} from "./data/FreeBooleanAlgebra.js";
|
|
9
|
+
export type {} from "./data/GenFailureDetails.js";
|
|
10
|
+
export type {} from "./data/LogLine.js";
|
|
11
|
+
export type {} from "./data/Render.js";
|
|
12
|
+
export type {} from "./data/RenderParam.js";
|
|
13
|
+
export type {} from "./data/Summary.js";
|
|
14
|
+
export type {} from "./data/TestAnnotation.js";
|
|
15
|
+
export type {} from "./data/TestAnnotationMap.js";
|
|
16
|
+
export type {} from "./data/TestArgs.js";
|
|
17
|
+
export type {} from "./data/TestConfig.js";
|
|
18
|
+
export type {} from "./data/TestFailure.js";
|
|
19
|
+
export type {} from "./data/TestSuccess.js";
|
|
20
|
+
export type {} from "./data/TestTimeoutException.js";
|
|
21
|
+
// codegen:end
|
package/_src/global.ts
ADDED
package/_src/index.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// codegen:start { preset: type-barrel, include: ./*.ts }
|
|
2
|
+
export type {} from "./api.js";
|
|
3
|
+
export type {} from "./control.js";
|
|
4
|
+
export type {} from "./data.js";
|
|
5
|
+
export type {} from "./demo.js";
|
|
6
|
+
export type {} from "./global.js";
|
|
7
|
+
export type {} from "./util.js";
|
|
8
|
+
// codegen:end
|
package/_src/util/math.ts
CHANGED
|
@@ -10,7 +10,7 @@ const INDEX_POSITIVE_INFINITY_32 = 2139095040; // floatToIndex(MAX_VALUE_32) + 1
|
|
|
10
10
|
/** @internal */
|
|
11
11
|
const INDEX_NEGATIVE_INFINITY_32 = -2139095041; // floatToIndex(-MAX_VALUE_32) - 1
|
|
12
12
|
|
|
13
|
-
export function safeFloatToIndex(f: number, label: string): IO<
|
|
13
|
+
export function safeFloatToIndex(f: number, label: string): IO<never, never, number> {
|
|
14
14
|
const conversionTrick = "you can convert any double to a 32-bit float by using `new Float32Array([myDouble])[0]`";
|
|
15
15
|
const errorMessage = "fc.floatNext constraints." + label + " must be a 32-bit float - " + conversionTrick;
|
|
16
16
|
if (Number.isNaN(f) || (Number.isFinite(f) && (f < -MAX_VALUE_32 || f > MAX_VALUE_32))) {
|
|
@@ -397,7 +397,7 @@ export function indexToDouble(index: ArrayInt64): number {
|
|
|
397
397
|
*
|
|
398
398
|
* @internal
|
|
399
399
|
*/
|
|
400
|
-
export function safeDoubleToIndex(d: number, label: string): IO<
|
|
400
|
+
export function safeDoubleToIndex(d: number, label: string): IO<never, never, ArrayInt64> {
|
|
401
401
|
if (Number.isNaN(d)) {
|
|
402
402
|
// Number.NaN does not have any associated index in the current implementation
|
|
403
403
|
return IO.haltNow(new Error("fc.doubleNext constraints." + label + " must be a 32-bit float"));
|
|
@@ -478,7 +478,7 @@ export function computeArrayInt64GenerateRange(
|
|
|
478
478
|
max: ArrayInt64,
|
|
479
479
|
biasFactor: number | undefined,
|
|
480
480
|
biasedRanges: { min: ArrayInt64; max: ArrayInt64 }[] | undefined,
|
|
481
|
-
):
|
|
481
|
+
): UIO<{ min: ArrayInt64; max: ArrayInt64 }> {
|
|
482
482
|
return IO.gen(function* (_) {
|
|
483
483
|
if (biasFactor === undefined || (yield* _(Random.nextIntBetween(1, biasFactor))) !== 1) {
|
|
484
484
|
return { min, max };
|
package/_src/util.ts
ADDED
package/api.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { IO } from "@fncts/io/IO";
|
|
1
|
+
import { IO } from "@fncts/io/IO/definition";
|
|
2
2
|
import { Lazy } from "@fncts/base/data/function/definition";
|
|
3
|
-
import {
|
|
4
|
-
import { Stream } from "@fncts/io/Stream";
|
|
3
|
+
import { Stream } from "@fncts/io/Stream/definition";
|
|
5
4
|
import { Either } from "@fncts/base/data/Either/definition";
|
|
6
5
|
import type { AssertResult } from "./control/Assertion.js";
|
|
7
6
|
import type { AssertionIO } from "./control/AssertionIO.js";
|
|
@@ -24,24 +23,24 @@ export declare function assert_<A>(value: A, assertion: Assertion<A>): TestResul
|
|
|
24
23
|
export declare function assertIO_<R, E, A>(io: IO<R, E, A>, assertion: AssertionIO<A>): IO<R, E, TestResult>;
|
|
25
24
|
export declare function suite<Specs extends ReadonlyArray<Spec<any, any>>>(label: string, ...specs: Specs): Spec<_R<Specs[number]>, _E<Specs[number]>>;
|
|
26
25
|
export declare function testIO<R, E>(label: string, assertion: Lazy<IO<R, E, TestResult>>): Spec<R, E>;
|
|
27
|
-
export declare function test(label: string, assertion: Lazy<TestResult>): Spec<
|
|
26
|
+
export declare function test(label: string, assertion: Lazy<TestResult>): Spec<never, never>;
|
|
28
27
|
/**
|
|
29
28
|
* @tsplus fluent fncts.test.Gen check
|
|
30
29
|
* @tsplus location "@fncts/test/api"
|
|
31
30
|
*/
|
|
32
|
-
export declare function check<R, A>(rv: Gen<R, A>, test: (a: A) => TestResult): IO<R
|
|
31
|
+
export declare function check<R, A>(rv: Gen<R, A>, test: (a: A) => TestResult): IO<R | TestConfig, never, TestResult>;
|
|
33
32
|
/**
|
|
34
33
|
* @tsplus fluent fncts.test.Gen check
|
|
35
34
|
* @tsplus location "@fncts/test/api"
|
|
36
35
|
*/
|
|
37
|
-
export declare function checkIO<R, A, R1, E>(rv: Gen<R, A>, test: (a: A) => IO<R1, E, TestResult>): IO<R
|
|
36
|
+
export declare function checkIO<R, A, R1, E>(rv: Gen<R, A>, test: (a: A) => IO<R1, E, TestResult>): IO<R | R1 | TestConfig, E, TestResult>;
|
|
38
37
|
/**
|
|
39
38
|
* @tsplus fluent fncts.test.Gen checkAllC
|
|
40
39
|
* @tsplus location "@fncts/test/api"
|
|
41
40
|
*/
|
|
42
|
-
export declare function checkAllC<R, A>(rv: Gen<R, A>, concurrency: number, test: (a: A) => TestResult): IO<R
|
|
41
|
+
export declare function checkAllC<R, A>(rv: Gen<R, A>, concurrency: number, test: (a: A) => TestResult): IO<R | TestConfig, never, TestResult>;
|
|
43
42
|
/**
|
|
44
43
|
* @tsplus fluent fncts.test.Gen checkAllC
|
|
45
44
|
* @tsplus location "@fncts/test/api"
|
|
46
45
|
*/
|
|
47
|
-
export declare function checkAllIOC<R, A, R1, E>(rv: Gen<R, A>, concurrency: number, test: (a: A) => IO<R1, E, TestResult>): IO<R
|
|
46
|
+
export declare function checkAllIOC<R, A, R1, E>(rv: Gen<R, A>, concurrency: number, test: (a: A) => IO<R1, E, TestResult>): IO<R | R1 | TestConfig, E, TestResult>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { URIO } from "@fncts/io/IO";
|
|
2
|
-
import { Has } from "@fncts/base/typeclass";
|
|
1
|
+
import { URIO } from "@fncts/io/IO/definition";
|
|
3
2
|
import type { Spec } from "@fncts/test/control/Spec";
|
|
4
3
|
import type { TestAspect } from "@fncts/test/control/TestAspect";
|
|
5
4
|
import type { TestLogger } from "@fncts/test/control/TestLogger";
|
|
@@ -9,7 +8,7 @@ export declare abstract class AbstractRunnableSpec<R, E> {
|
|
|
9
8
|
abstract aspects: ReadonlyArray<TestAspect<R, any>>;
|
|
10
9
|
abstract runner: TestRunner<R, E>;
|
|
11
10
|
abstract spec: Spec<R, E>;
|
|
12
|
-
get _run(): URIO<
|
|
13
|
-
runSpec(spec: Spec<R, E>): URIO<
|
|
11
|
+
get _run(): URIO<TestLogger, ExecutedSpec<E>>;
|
|
12
|
+
runSpec(spec: Spec<R, E>): URIO<TestLogger, ExecutedSpec<E>>;
|
|
14
13
|
get platform(): import("@fncts/io/RuntimeConfig").RuntimeConfig;
|
|
15
14
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { URIO, IO } from "@fncts/io/IO";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Fiber } from "@fncts/io/Fiber";
|
|
1
|
+
import { URIO, IO } from "@fncts/io/IO/definition";
|
|
2
|
+
import { HashSet } from "@fncts/base/collection/immutable/HashSet/definition";
|
|
3
|
+
import { Fiber } from "@fncts/io/Fiber/definition";
|
|
5
4
|
import type { TestAnnotation } from "../../data/TestAnnotation.js";
|
|
6
5
|
import type { Annotated } from "./definition.js";
|
|
7
6
|
import { Annotations } from "./definition.js";
|
|
@@ -9,19 +8,19 @@ import { Annotations } from "./definition.js";
|
|
|
9
8
|
* @tsplus static fncts.test.AnnotationsOps annotate
|
|
10
9
|
* @tsplus location "@fncts/test/control/Annotations/api"
|
|
11
10
|
*/
|
|
12
|
-
export declare function annotate<V>(key: TestAnnotation<V>, value: V): URIO<
|
|
11
|
+
export declare function annotate<V>(key: TestAnnotation<V>, value: V): URIO<Annotations, void>;
|
|
13
12
|
/**
|
|
14
13
|
* @tsplus static fncts.test.AnnotationsOps get
|
|
15
14
|
* @tsplus location "@fncts/test/control/Annotations/api"
|
|
16
15
|
*/
|
|
17
|
-
export declare function get<V>(key: TestAnnotation<V>): URIO<
|
|
16
|
+
export declare function get<V>(key: TestAnnotation<V>): URIO<Annotations, V>;
|
|
18
17
|
/**
|
|
19
18
|
* @tsplus static fncts.test.AnnotationsOps withAnnotations
|
|
20
19
|
* @tsplus location "@fncts/test/control/Annotations/api"
|
|
21
20
|
*/
|
|
22
|
-
export declare function withAnnotation<R, E, A>(io: IO<R, E, A>): IO<R
|
|
21
|
+
export declare function withAnnotation<R, E, A>(io: IO<R, E, A>): IO<R | Annotations, Annotated<E>, Annotated<A>>;
|
|
23
22
|
/**
|
|
24
23
|
* @tsplus static fncts.test.AnnotationsOps supervisedFibers
|
|
25
24
|
* @tsplus location "@fncts/test/control/Annotations/api"
|
|
26
25
|
*/
|
|
27
|
-
export declare const supervisedFibers: URIO<
|
|
26
|
+
export declare const supervisedFibers: URIO<Annotations, HashSet<Fiber.Runtime<any, any>>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { UIO, IO } from "@fncts/io/IO";
|
|
2
|
-
import { HashSet } from "@fncts/base/collection/immutable/HashSet";
|
|
3
|
-
import { Fiber } from "@fncts/io/Fiber";
|
|
1
|
+
import { UIO, IO } from "@fncts/io/IO/definition";
|
|
2
|
+
import { HashSet } from "@fncts/base/collection/immutable/HashSet/definition";
|
|
3
|
+
import { Fiber } from "@fncts/io/Fiber/definition";
|
|
4
4
|
import type { TestAnnotation } from "../../data/TestAnnotation.js";
|
|
5
5
|
import type { TestAnnotationMap } from "../../data/TestAnnotationMap.js";
|
|
6
6
|
export declare type Annotated<A> = readonly [A, TestAnnotationMap];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FiberRef } from "@fncts/io/FiberRef";
|
|
2
|
-
import { UIO, IO } from "@fncts/io/IO";
|
|
3
|
-
import { HashSet } from "@fncts/base/collection/immutable/HashSet";
|
|
4
|
-
import { Fiber } from "@fncts/io/Fiber";
|
|
5
|
-
import { Equatable } from "@fncts/base/typeclass";
|
|
1
|
+
import { FiberRef } from "@fncts/io/FiberRef/definition";
|
|
2
|
+
import { UIO, IO } from "@fncts/io/IO/definition";
|
|
3
|
+
import { HashSet } from "@fncts/base/collection/immutable/HashSet/definition";
|
|
4
|
+
import { Fiber } from "@fncts/io/Fiber/definition";
|
|
5
|
+
import { Equatable } from "@fncts/base/typeclass/Equatable";
|
|
6
6
|
import { TestAnnotation } from "../../data/TestAnnotation.js";
|
|
7
7
|
import { TestAnnotationMap } from "../../data/TestAnnotationMap.js";
|
|
8
8
|
import { Annotations } from "./definition.js";
|
|
@@ -10,12 +10,12 @@ export declare class LiveAnnotations extends Annotations {
|
|
|
10
10
|
private fiberRef;
|
|
11
11
|
constructor(fiberRef: FiberRef<TestAnnotationMap>);
|
|
12
12
|
annotate<V>(key: TestAnnotation<V>, value: V): UIO<void>;
|
|
13
|
-
get<V>(key: TestAnnotation<V>): import("@fncts/io/IO.js").IO<
|
|
13
|
+
get<V>(key: TestAnnotation<V>): import("@fncts/io/IO.js").IO<never, never, V>;
|
|
14
14
|
withAnnotation<R, E, A>(io: IO<R, E, A>): import("@fncts/io/IO.js").IO<R, readonly [E, TestAnnotationMap], readonly [A, TestAnnotationMap]>;
|
|
15
|
-
supervisedFibers: import("@fncts/io/IO.js").IO<
|
|
15
|
+
supervisedFibers: import("@fncts/io/IO.js").IO<never, never, import("@fncts/base/collection/immutable/HashSet.js").HashSet<import("@fncts/io/Fiber.js").Fiber.Runtime<any, any>>>;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* @tsplus static fncts.test.AnnotationsOps Live
|
|
19
19
|
* @tsplus location "@fncts/test/control/Annotations/live"
|
|
20
20
|
*/
|
|
21
|
-
export declare const live: import("@fncts/io/Layer.js").Layer<
|
|
21
|
+
export declare const live: import("@fncts/io/Layer.js").Layer<never, never, Annotations>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LazyValue } from "@fncts/base/control/LazyValue";
|
|
2
|
-
import { Maybe } from "@fncts/base/data/Maybe";
|
|
3
|
-
import { Cause } from "@fncts/base/data/Cause";
|
|
2
|
+
import { Maybe } from "@fncts/base/data/Maybe/definition";
|
|
3
|
+
import { Cause } from "@fncts/base/data/Cause/definition";
|
|
4
4
|
import { Exit } from "@fncts/base/data/Exit/definition";
|
|
5
5
|
import { Either } from "@fncts/base/data/Either/definition";
|
|
6
6
|
import type { Eq } from "@fncts/base/typeclass";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IO } from "@fncts/io/IO";
|
|
1
|
+
import { IO } from "@fncts/io/IO/definition";
|
|
2
2
|
import type { AssertionValue } from "../../data/AssertionValue.js";
|
|
3
3
|
import type { FreeBooleanAlgebra } from "../../data/FreeBooleanAlgebra.js";
|
|
4
4
|
import type { Render } from "../../data/Render.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AssertionValue } from "../../data/AssertionValue.js";
|
|
2
2
|
import type { Render } from "../../data/Render.js";
|
|
3
3
|
import type { FreeBooleanAlgebraIO } from "../FreeBooleanAlgebraIO.js";
|
|
4
|
-
export declare type AssertResultIO<A> = FreeBooleanAlgebraIO<
|
|
4
|
+
export declare type AssertResultIO<A> = FreeBooleanAlgebraIO<never, never, AssertionValue<A>>;
|
|
5
5
|
export declare const AssertionIOTypeId: unique symbol;
|
|
6
6
|
export declare type AssertionIOTypeId = typeof AssertionIOTypeId;
|
|
7
7
|
/**
|
|
@@ -2,6 +2,6 @@ import { RunnableSpec } from "@fncts/test/control/RunnableSpec";
|
|
|
2
2
|
import { TestEnvironment } from "@fncts/test/control/TestEnvironment";
|
|
3
3
|
import { TestRunner } from "@fncts/test/control/TestRunner";
|
|
4
4
|
export declare abstract class DefaultRunnableSpec extends RunnableSpec<TestEnvironment, any> {
|
|
5
|
-
aspects: import("@fncts/test/control/TestAspect").TestAspect<import("
|
|
6
|
-
runner: TestRunner<import("
|
|
5
|
+
aspects: import("@fncts/test/control/TestAspect").TestAspect<import("./Live").Live, any>[];
|
|
6
|
+
runner: TestRunner<import("./Sized").Sized | import("./Annotations").Annotations | import("../data/TestConfig").TestConfig | import("@fncts/io/Clock").Clock | import("@fncts/io/Random").Random | import("@fncts/io/Console").Console | import("./Live").Live | import("./TestClock").TestClock | import("./TestConsole").TestConsole | import("./TestRandom").TestRandom, unknown>;
|
|
7
7
|
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { URIO } from "@fncts/io/IO";
|
|
2
|
-
import { Has } from "@fncts/base/typeclass";
|
|
1
|
+
import { URIO } from "@fncts/io/IO/definition";
|
|
3
2
|
import { Vector } from "@fncts/base/collection/immutable/Vector";
|
|
4
|
-
import { List, Cons } from "@fncts/base/collection/immutable/List";
|
|
5
|
-
import { Maybe } from "@fncts/base/data/Maybe";
|
|
6
|
-
import { Cause } from "@fncts/base/data/Cause";
|
|
3
|
+
import { List, Cons } from "@fncts/base/collection/immutable/List/definition";
|
|
4
|
+
import { Maybe } from "@fncts/base/data/Maybe/definition";
|
|
5
|
+
import { Cause } from "@fncts/base/data/Cause/definition";
|
|
7
6
|
import type { ExecutedSpec } from "../../data/ExecutedSpec.js";
|
|
8
7
|
import type { ExecutionResult } from "../../data/ExecutionResult.js";
|
|
9
8
|
import type { TestAnnotationRenderer } from "../TestAnnotationRenderer.js";
|
|
10
9
|
import type { TestRenderer } from "../TestRenderer/definition.js";
|
|
11
10
|
import { TestLogger } from "../TestLogger.js";
|
|
12
|
-
export declare type TestReporter<E> = (duration: number, spec: ExecutedSpec<E>) => URIO<
|
|
11
|
+
export declare type TestReporter<E> = (duration: number, spec: ExecutedSpec<E>) => URIO<TestLogger, void>;
|
|
13
12
|
/**
|
|
14
13
|
* @tsplus static fncts.test.DefaultTestReporter report
|
|
15
14
|
* @tsplus location "@fncts/test/control/DefaultTestReporter/render"
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { IO } from "@fncts/io/IO";
|
|
1
|
+
import { IO } from "@fncts/io/IO/definition";
|
|
2
2
|
import type { FreeBooleanAlgebraIO } from "./definition.js";
|
|
3
3
|
/**
|
|
4
4
|
* @tsplus fluent fncts.test.FreeBooleanAlgebraIO and
|
|
5
5
|
* @tsplus operator fncts.test.FreeBooleanAlgebraIO &&
|
|
6
6
|
* @tsplus location "@fncts/test/control/FreeBooleanAlgebraIO/api"
|
|
7
7
|
*/
|
|
8
|
-
export declare function and_<R, E, A extends A1, R1, E1, A1>(self: FreeBooleanAlgebraIO<R, E, A>, that: FreeBooleanAlgebraIO<R1, E1, A1>): FreeBooleanAlgebraIO<R
|
|
8
|
+
export declare function and_<R, E, A extends A1, R1, E1, A1>(self: FreeBooleanAlgebraIO<R, E, A>, that: FreeBooleanAlgebraIO<R1, E1, A1>): FreeBooleanAlgebraIO<R | R1, E | E1, A | A1>;
|
|
9
9
|
/**
|
|
10
10
|
* @tsplus fluent fncts.test.FreeBooleanAlgebraIO or
|
|
11
11
|
* @tsplus operator fncts.test.FreeBooleanAlgebraIO ||
|
|
12
12
|
* @tsplus location "@fncts/test/control/FreeBooleanAlgebraIO/api"
|
|
13
13
|
*/
|
|
14
|
-
export declare function or_<R, E, A extends A1, R1, E1, A1>(self: FreeBooleanAlgebraIO<R, E, A>, that: FreeBooleanAlgebraIO<R1, E1, A1>): FreeBooleanAlgebraIO<R
|
|
14
|
+
export declare function or_<R, E, A extends A1, R1, E1, A1>(self: FreeBooleanAlgebraIO<R, E, A>, that: FreeBooleanAlgebraIO<R1, E1, A1>): FreeBooleanAlgebraIO<R | R1, E | E1, A | A1>;
|
|
15
15
|
/**
|
|
16
16
|
* @tsplus fluent fncts.test.FreeBooleanAlgebraIO invert
|
|
17
17
|
* @tsplus location "@fncts/test/control/FreeBooleanAlgebraIO/api"
|
|
@@ -31,12 +31,12 @@ export declare function isFailure<R, E, A>(self: FreeBooleanAlgebraIO<R, E, A>):
|
|
|
31
31
|
* @tsplus static fncts.test.FreeBooleanAlgebraIOOps success
|
|
32
32
|
* @tsplus location "@fncts/test/control/FreeBooleanAlgebraIO/api"
|
|
33
33
|
*/
|
|
34
|
-
export declare function success<A>(a: A): FreeBooleanAlgebraIO<
|
|
34
|
+
export declare function success<A>(a: A): FreeBooleanAlgebraIO<never, never, A>;
|
|
35
35
|
/**
|
|
36
36
|
* @tsplus static fncts.test.FreeBooleanAlgebraIOOps failure
|
|
37
37
|
* @tsplus location "@fncts/test/control/FreeBooleanAlgebraIO/api"
|
|
38
38
|
*/
|
|
39
|
-
export declare function failure<A>(a: A): FreeBooleanAlgebraIO<
|
|
39
|
+
export declare function failure<A>(a: A): FreeBooleanAlgebraIO<never, never, A>;
|
|
40
40
|
/**
|
|
41
41
|
* @tsplus static fncts.test.FreeBooleanAlgebraIOOps fromIO
|
|
42
42
|
* @tsplus location "@fncts/test/control/FreeBooleanAlgebraIO/api"
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Has } from "@fncts/base/typeclass";
|
|
2
1
|
import type { Sized } from "../../Sized.js";
|
|
3
2
|
import type { EqConstraint, LengthConstraints } from "../constraints.js";
|
|
4
3
|
import { Gen } from "../definition.js";
|
|
@@ -6,7 +5,7 @@ import { Gen } from "../definition.js";
|
|
|
6
5
|
* @tsplus fluent fncts.test.Gen array
|
|
7
6
|
* @tsplus location "@fncts/test/control/Gen/api/array"
|
|
8
7
|
*/
|
|
9
|
-
export declare function array<R, A>(g: Gen<R, A>, constraints?: LengthConstraints): Gen<R
|
|
8
|
+
export declare function array<R, A>(g: Gen<R, A>, constraints?: LengthConstraints): Gen<R | Sized, ReadonlyArray<A>>;
|
|
10
9
|
/**
|
|
11
10
|
* @tsplus fluent fncts.test.Gen arrayN
|
|
12
11
|
* @tsplus location "@fncts/test/control/Gen/api/array"
|
|
@@ -16,4 +15,4 @@ export declare function arrayN_<R, A>(self: Gen<R, A>, n: number): Gen<R, Readon
|
|
|
16
15
|
* @tsplus fluent fncts.test.Gen uniqueArray
|
|
17
16
|
* @tsplus location "@fncts/test/control/Gen/api/array"
|
|
18
17
|
*/
|
|
19
|
-
export declare function uniqueArray_<R, A>(gen: Gen<R, A>, constraints?: LengthConstraints & EqConstraint<A>): Gen<
|
|
18
|
+
export declare function uniqueArray_<R, A>(gen: Gen<R, A>, constraints?: LengthConstraints & EqConstraint<A>): Gen<Sized | R, ReadonlyArray<A>>;
|
|
@@ -4,44 +4,44 @@ import { Gen } from "../definition.js";
|
|
|
4
4
|
* @tsplus static fncts.test.GenOps alphaNumericChar
|
|
5
5
|
* @tsplus location "@fncts/test/control/Gen/api/char"
|
|
6
6
|
*/
|
|
7
|
-
export declare const alphaNumericChar: Gen<
|
|
7
|
+
export declare const alphaNumericChar: Gen<never, string>;
|
|
8
8
|
/**
|
|
9
9
|
* @tsplus static fncts.test.GenOps asciiChar
|
|
10
10
|
* @tsplus location "@fncts/test/control/Gen/api/char"
|
|
11
11
|
*/
|
|
12
|
-
export declare const asciiChar: Gen<
|
|
12
|
+
export declare const asciiChar: Gen<never, string>;
|
|
13
13
|
/**
|
|
14
14
|
* @tsplus static fncts.test.GenOps base64Char
|
|
15
15
|
* @tsplus location "@fncts/test/control/Gen/api/char"
|
|
16
16
|
*/
|
|
17
|
-
export declare const base64Char: Gen<
|
|
17
|
+
export declare const base64Char: Gen<never, string>;
|
|
18
18
|
/**
|
|
19
19
|
* @tsplus static fncts.test.GenOps char
|
|
20
20
|
* @tsplus location "@fncts/test/control/Gen/api/char"
|
|
21
21
|
*/
|
|
22
|
-
export declare function char(constraints: Required<NumberConstraints>): Gen<
|
|
22
|
+
export declare function char(constraints: Required<NumberConstraints>): Gen<never, string>;
|
|
23
23
|
/**
|
|
24
24
|
* @tsplus static fncts.test.GenOps char16
|
|
25
25
|
* @tsplus location "@fncts/test/control/Gen/api/char"
|
|
26
26
|
*/
|
|
27
|
-
export declare const char16: Gen<
|
|
27
|
+
export declare const char16: Gen<never, string>;
|
|
28
28
|
/**
|
|
29
29
|
* @tsplus static fncts.test.GenOps fullUnicodeChar
|
|
30
30
|
* @tsplus location "@fncts/test/control/Gen/api/char"
|
|
31
31
|
*/
|
|
32
|
-
export declare const fullUnicodeChar: Gen<
|
|
32
|
+
export declare const fullUnicodeChar: Gen<never, string>;
|
|
33
33
|
/**
|
|
34
34
|
* @tsplus static fncts.test.GenOps hexChar
|
|
35
35
|
* @tsplus location "@fncts/test/control/Gen/api/char"
|
|
36
36
|
*/
|
|
37
|
-
export declare const hexChar: Gen<
|
|
37
|
+
export declare const hexChar: Gen<never, string>;
|
|
38
38
|
/**
|
|
39
39
|
* @tsplus static fncts.test.GenOps printableChar
|
|
40
40
|
* @tsplus location "@fncts/test/control/Gen/api/char"
|
|
41
41
|
*/
|
|
42
|
-
export declare const printableChar: Gen<
|
|
42
|
+
export declare const printableChar: Gen<never, string>;
|
|
43
43
|
/**
|
|
44
44
|
* @tsplus static fncts.test.GenOps unicodeChar
|
|
45
45
|
* @tsplus location "@fncts/test/control/Gen/api/char"
|
|
46
46
|
*/
|
|
47
|
-
export declare const unicodeChar: Gen<
|
|
47
|
+
export declare const unicodeChar: Gen<never, string>;
|