本文整理汇总了TypeScript中ava.AssertContext类的典型用法代码示例。如果您正苦于以下问题:TypeScript AssertContext类的具体用法?TypeScript AssertContext怎么用?TypeScript AssertContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AssertContext类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: test
test("randomInt32-upper-bound-is-excluded", (t: AssertContext) => {
// WARNING: No deterministric test (no seeded radom function)
for (let i = 0; i < 100; i++) {
t.is(randomInt32(0, 1), 0)
t.is(randomInt32(-1, 0), -1)
}
})
开发者ID:coast-team,项目名称:mute-structs,代码行数:7,代码来源:int32.test.ts
示例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)
})
开发者ID:coast-team,项目名称:mute-structs,代码行数:8,代码来源:identifiertuple.test.ts
示例3: test
test("two-noncontiguous-bases", (t: AssertContext) => {
const replicaNumber = 0
const clock = 1
const id1: Identifier = new Identifier([new IdentifierTuple(0, replicaNumber, clock - 1, 0)])
const id2: Identifier = new Identifier([new IdentifierTuple(42, 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)
})
开发者ID:coast-team,项目名称:mute-structs,代码行数:11,代码来源:idfactory.test.ts
示例4: test
test("union-prepend-append", (t: AssertContext) => {
const begin = 0
const end = 5
const idInterval = generateIdInterval(begin, end)
const aBegin = -5
const aEnd = 10
const unionInterval = idInterval.union(aBegin, aEnd)
const expectedBegin = aBegin
const expectedEnd = aEnd
t.is(unionInterval.begin, expectedBegin)
t.is(unionInterval.end, expectedEnd)
})
开发者ID:coast-team,项目名称:mute-structs,代码行数:15,代码来源:identifierinterval.test.ts
示例5: equalsBaseMacro
function equalsBaseMacro (
t: AssertContext,
id1: Identifier, id2: Identifier, expected: boolean): void {
const actual = id1.equalsBase(id2)
t.is(actual, expected)
}
开发者ID:coast-team,项目名称:mute-structs,代码行数:7,代码来源:identifier.test.ts
示例6: equalsBaseMacro
/**
* Macro to check if equalsBase() returns the expected result
*/
function equalsBaseMacro (
t: AssertContext,
tuple: IdentifierTuple, other: IdentifierTuple,
expected: boolean): void {
const actual: boolean = tuple.equalsBase(other)
t.is(actual, expected)
}
开发者ID:coast-team,项目名称:mute-structs,代码行数:11,代码来源:identifiertuple.test.ts
注:本文中的ava.AssertContext类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论