本文整理汇总了TypeScript中jsverify.property函数的典型用法代码示例。如果您正苦于以下问题:TypeScript property函数的具体用法?TypeScript property怎么用?TypeScript property使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了property函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: describe
describe('Applicative instance', () => {
jsv.property('identity', jsv.nat, a =>
T.toPromise(T.bothPar(
Par.of(a)['fantasy-land/ap'](Par.of((x: any) => x)).sequential(),
Par.of(a).sequential()
).map(tEquals))
);
jsv.property('homomorphism', jsv.nat, jsv.fn(jsv.nat), (a, f) =>
T.toPromise(T.bothPar(
Par.of(a)['fantasy-land/ap'](Par.of(f)).sequential(),
Par.of(f(a)).sequential()
).map(tEquals))
);
jsv.property('interchange', jsv.nat, jsv.fn(jsv.nat), (a, f) =>
T.toPromise(T.bothPar(
Par.of(a)['fantasy-land/ap'](Par.of(f)).sequential(),
Par.of(f)['fantasy-land/ap'](Par.of((g: (_: number) => number) => g(a))).sequential()
).map(tEquals))
);
jsv.property('mergePar', jsv.array(jsv.nat), xs =>
T.toPromise(T.bothPar(
T.sequencePar(xs.map(T.pure)),
T.pure(xs)
).map(tEquals))
);
});
示例2: describe
describe('mapMaybe', () => {
jsv.property('functor identity', maybeArb(jsv.nat), t => deepEq(t, M.mapMaybe(t, id)));
jsv.property('functor compose', maybeArb(jsv.nat), jsv.fn(jsv.nat), jsv.fn(jsv.nat), (t, f, g) =>
deepEq(M.mapMaybe(t, x => f(g(x))), M.mapMaybe(M.mapMaybe(t, g), f))
);
});
示例3: describe
describe('FileInfo property', function () {
jsv.property('Setoid reflexivity', fileInfoArb, (finfo) => finfo.equals(finfo) );
jsv.property('Setoid symmetry', fileInfoArb, fileInfoArb, (a, b) =>
a.equals(b) === b.equals(a)
);
});
示例4: describe
describe('bimapEither', () => {
jsv.property('maps the first function over the left value', leftArb(jsv.nat), jsv.fn(jsv.nat),
jsv.fn(jsv.nat), (t, f, g) => deepEq(E.bimapEither(t, f, g).value, f(t.value)));
jsv.property('maps the second function over the right value', rightArb(jsv.nat), jsv.fn(jsv.nat),
jsv.fn(jsv.nat), (t, f, g) => deepEq(E.bimapEither(t, g, g), E.mapEither(t, g)));
});