本文整理匯總了TypeScript中@ephox/bedrock.assert.eq方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript assert.eq方法的具體用法?TypeScript assert.eq怎麽用?TypeScript assert.eq使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@ephox/bedrock.assert
的用法示例。
在下文中一共展示了assert.eq方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
result.fold((resultErr) => {
assert.eq(err, resultErr);
}, (resultValue) => {
示例2: nuSize
UnitTest.test('SizeInputNuTest', () => {
assert.eq({value: 4, unit: 'px'}, nuSize(4, 'px'));
assert.eq({value: 234, unit: ''}, nuSize(234, ''));
assert.eq({value: 36, unit: 'em'}, nuSize(36, 'em'));
});
示例3:
const check = (url, expected) => {
const pattern = UrlPatterns.matchPattern(url);
assert.eq(expected, pattern.url);
};
示例4: function
const testIsAbsoluteUrl = function () {
assert.eq(UrlType.isAbsolute('http://www.site.com'), true);
assert.eq(UrlType.isAbsolute('https://www.site.com'), true);
assert.eq(UrlType.isAbsolute('www.site.com'), false);
assert.eq(UrlType.isAbsolute('file.gif'), false);
};
示例5: function
const testParse = function () {
assert.eq(null, AutocompleteContext.parse('', 0, '@', 2).getOr(null));
assert.eq(null, AutocompleteContext.parse('abc', 0, '@', 2).getOr(null));
assert.eq(null, AutocompleteContext.parse('@abc', 0, '@', 2).getOr(null));
assert.eq(null, AutocompleteContext.parse('@abc', 1, '@', 2).getOr(null));
assert.eq('a', AutocompleteContext.parse('@abc', 2, '@', 2).getOr(null));
assert.eq('abc', AutocompleteContext.parse('@abc', 40, '@', 2).getOr(null));
assert.eq('abc', AutocompleteContext.parse('@def@abc', 40, '@', 2).getOr(null));
assert.eq(null, AutocompleteContext.parse('@abc x', 40, '@', 2).getOr(null));
assert.eq(null, AutocompleteContext.parse('@abc\u00a0x', 40, '@', 2).getOr(null));
assert.eq(null, AutocompleteContext.parse('@abc\tx', 40, '@', 2).getOr(null));
assert.eq(null, AutocompleteContext.parse('@abc\nx', 40, '@', 2).getOr(null));
assert.eq('abc', AutocompleteContext.parse('@abc 123', 4, '@', 2).getOr(null));
};
示例6: function
handler = function (rects) {
assert.eq(rects.elementRect, clientRect(40, 0, 10, 10));
assert.eq(rects.contentAreaRect, clientRect(0, 0, 100, 100));
assert.eq(rects.panelRect, clientRect(0, 0, 20, 10));
return clientRect(1, 2, 3, 4);
};
示例7:
mostUsedTopLevelDomains.forEach(function (tld) {
assert.eq(UrlType.isDomainLike('site.' + tld), true);
assert.eq(UrlType.isDomainLike(' site.' + tld), true);
assert.eq(UrlType.isDomainLike('site.' + tld + ' '), true);
});
示例8: function
const testConvert = function () {
assert.eq({ x: 1, y: 2, w: 3, h: 4 }, Convert.fromClientRect({ left: 1, top: 2, width: 3, height: 4 }));
assert.eq({ x: 2, y: 3, w: 4, h: 5 }, Convert.fromClientRect({ left: 2, top: 3, width: 4, height: 5 }));
assert.eq({ left: 1, top: 2, width: 3, height: 4, bottom: 2 + 4, right: 1 + 3 }, Convert.toClientRect({ x: 1, y: 2, w: 3, h: 4 }));
assert.eq({ left: 2, top: 3, width: 4, height: 5, bottom: 3 + 5, right: 2 + 4 }, Convert.toClientRect({ x: 2, y: 3, w: 4, h: 5 }));
};
示例9: function
const testUuid = function () {
assert.eq(Uuid.uuid('mce').indexOf('mce'), 0);
assert.eq(Uuid.uuid('mce') !== Uuid.uuid('mce'), true);
};