Run prettier + add missing pointWiseAdd signature
This commit is contained in:
parent
8f49b64083
commit
d6c541036f
|
@ -1,8 +1,4 @@
|
|||
import {
|
||||
run,
|
||||
Distribution,
|
||||
resultMap,
|
||||
} from "../src/js/index";
|
||||
import { run, Distribution, resultMap } from "../src/js/index";
|
||||
|
||||
let testRun = (x: string) => {
|
||||
let result = run(x);
|
||||
|
@ -14,7 +10,7 @@ let testRun = (x: string) => {
|
|||
};
|
||||
|
||||
function Ok<b>(x: b) {
|
||||
return { tag: "Ok", value: x}
|
||||
return { tag: "Ok", value: x };
|
||||
}
|
||||
|
||||
describe("Simple calculations and results", () => {
|
||||
|
@ -81,14 +77,16 @@ describe("Distribution", () => {
|
|||
});
|
||||
test("algebraicAdd", () => {
|
||||
expect(
|
||||
resultMap(dist.algebraicAdd(dist2), (r: Distribution) => r.toSparkline(20))
|
||||
.value
|
||||
resultMap(dist.algebraicAdd(dist2), (r: Distribution) =>
|
||||
r.toSparkline(20)
|
||||
).value
|
||||
).toEqual(Ok("▁▁▂▄▆████▇▆▄▄▃▃▃▂▁▁▁"));
|
||||
});
|
||||
test("pointwiseAdd", () => {
|
||||
expect(
|
||||
resultMap(dist.pointwiseAdd(dist2), (r: Distribution) => r.toSparkline(20))
|
||||
.value
|
||||
resultMap(dist.pointwiseAdd(dist2), (r: Distribution) =>
|
||||
r.toSparkline(20)
|
||||
).value
|
||||
).toEqual(Ok("▁▂▅██▅▅▅▆▇█▆▅▃▃▂▂▁▁▁"));
|
||||
});
|
||||
});
|
||||
|
|
|
@ -185,7 +185,7 @@ export class Distribution {
|
|||
);
|
||||
}
|
||||
|
||||
pointwiseAdd(d2: Distribution) {
|
||||
pointwiseAdd(d2: Distribution): result<Distribution, error> {
|
||||
return this.mapResultDist(
|
||||
Constructors_pointwiseAdd({ env: this.env }, this.t, d2.t)
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue
Block a user