當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript AssertContext.is方法代碼示例

本文整理匯總了TypeScript中ava.AssertContext.is方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript AssertContext.is方法的具體用法?TypeScript AssertContext.is怎麽用?TypeScript AssertContext.is使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ava.AssertContext的用法示例。


在下文中一共展示了AssertContext.is方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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("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

示例3: 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

示例4: 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

示例5: compareBaseMacro

function compareBaseMacro (t: AssertContext,
    idInterval1: IdentifierInterval, idInterval2: IdentifierInterval,
    expected: IdentifierIteratorResults): void {

    const actual: IdentifierIteratorResults =
        compareBase(idInterval1, idInterval2)
    t.is(actual, expected)
}
開發者ID:Conaclos,項目名稱:mute-structs,代碼行數:8,代碼來源:iteratorhelperidentifier.test.ts

示例6: 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

示例7: 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.is方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。