本文整理匯總了TypeScript中neuroglancer/util/uint64.Uint64.equal方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Uint64.equal方法的具體用法?TypeScript Uint64.equal怎麽用?TypeScript Uint64.equal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類neuroglancer/util/uint64.Uint64
的用法示例。
在下文中一共展示了Uint64.equal方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('equal', () => {
let a = new Uint64(1, 2);
let b = new Uint64(1, 2);
expect(Uint64.equal(a, b)).toBe(true);
expect(Uint64.equal(a, new Uint64(1, 3))).toBe(false);
expect(Uint64.equal(a, new Uint64(2, 1))).toBe(false);
});
示例2: compareViaGet
function compareViaGet() {
let value = new Uint64();
for (let [s, expectedValue] of map) {
let key = Uint64.parseString(s);
let has = ht.get(key, value);
expect(has && Uint64.equal(value, expectedValue))
.toBe(
true,
`Hash table maps ${key} -> ${has ? value : undefined} rather than -> ${expectedValue}`);
}
}
示例3: compareViaIterate
function compareViaIterate() {
let htValues = new Map<string, Uint64>();
for (let [key, value] of ht) {
let s = key.toString();
expect(htValues.has(s)).toBe(false, `Duplicate key in hash table: ${s}`);
expect(map.has(s)).toBe(true, `Unexpected key ${s} in hash table`);
htValues.set(s, value.clone());
}
for (let [s, value] of map) {
let v = htValues.get(s);
expect(v !== undefined && Uint64.equal(v, value))
.toBe(true, `Hash table maps ${s} -> ${v} rather than -> ${value}`);
}
}