本文整理汇总了TypeScript中ava.AssertContext.true方法的典型用法代码示例。如果您正苦于以下问题:TypeScript AssertContext.true方法的具体用法?TypeScript AssertContext.true怎么用?TypeScript AssertContext.true使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ava.AssertContext
的用法示例。
在下文中一共展示了AssertContext.true方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: test
test("randomInt32-in-interval", (t: AssertContext) => {
// WARNING: No deterministric test (no seeded radom function)
for (let i = 0; i < 100; i++) {
const r = randomInt32(INT32_BOTTOM, INT32_TOP)
t.true(isInt32(r) && r !== INT32_TOP)
}
})
示例2: test
test("generateWithSameBase", (t: AssertContext) => {
const expected = 5
const tuple1: IdentifierTuple = new IdentifierTuple(42, 7, 8, 26)
const tuple2: IdentifierTuple = IdentifierTuple.fromBase(tuple1, expected)
t.true(tuple1.equalsBase(tuple2))
t.is(tuple2.offset, expected)
})
示例3: test
test("two-contiguous-bases", (t: AssertContext) => {
const replicaNumber = 0
const clock = 1
const tuple: IdentifierTuple = new IdentifierTuple(0, replicaNumber, clock - 1, 0)
const id1: Identifier = new Identifier([tuple])
const id2: Identifier = new Identifier([new IdentifierTuple(1, 0, 0, 0)])
const newId: Identifier = createBetweenPosition(id1, id2, replicaNumber, clock)
t.is(id1.compareTo(newId), Ordering.Less)
t.is(newId.compareTo(id2), Ordering.Less)
t.is(newId.length, id1.length + 1)
t.true(id1.isPrefix(newId))
})