本文整理匯總了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)));
});