本文整理汇总了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}`);
}
}