MCPcopy Create free account
hub / github.com/codebox/homoglyph / check

Function check

node/test/spec/DataTests.js:4–14  ·  view source on GitHub ↗
(targetChar, homoglyphs)

Source from the content-addressed store, hash-verified

2
3describe("Homoglyph Search - Data Tests", function () {
4 function check(targetChar, homoglyphs){
5 describe("Homoglyphs of '" + targetChar + "'", function(){
6 homoglyphs.forEach(function (c) {
7 it("Checking '" + c + "'", function () {
8 var textContainingHomoglyph = 'xx' + c + 'xx',
9 targetWord = 'xx' + targetChar + 'xx';
10 expect(homoglyphSearch.search(textContainingHomoglyph, [targetWord])).toEqual([{match: textContainingHomoglyph, word: targetWord, index: 0}]);
11 })
12 });
13 })
14 }
15
16 check("0", ['\u{10404}', '\u{2c9e}', '\u{1d6b6}', '\u{041e}', '\u{0b20}', '\u{118b5}', '\u{1d512}', '\u{ff2f}', '\u{10516}', '\u{1d40e}', '\u{ff10}', '\u{1d5ae}', '\u{1d7ce}', '\u{118e0}', '\u{3007}', '\u{1d7f6}', '\u{1d67e}', '\u{1d79e}', '\u{09e6}', '\u{1d64a}', '\u{1d5e2}', '\u{0d20}', '\u{114d0}', '\u{1d476}', '\u{1d57a}', '\u{0555}', '\u{1d7ec}', '\u{1d4de}', '\u{1d7e2}', '\u{1d72a}', '\u{0b66}', '\u{1d546}', '\u{1d7d8}', '\u{1d616}', '\u{1d4aa}', '\u{1d6f0}', '\u{07c0}', '\u{004f}', '\u{10292}', '\u{a4f3}', '\u{1d764}', '\u{1d442}', '\u{2d54}', '\u{102ab}', '\u{039f}']);
17 check("1", ['\u{1d48d}', '\u{1d408}', '\u{05c0}', '\u{0627}', '\u{0196}', '\u{1d5dc}', '\u{1d644}', '\u{1d7e3}', '\u{1d798}', '\u{1d7ed}', '\u{16c1}', '\u{10320}', '\u{1d55d}', '\u{007c}', '\u{1d470}', '\u{1d574}', '\u{1d459}', '\u{2223}', '\u{1d661}', '\u{0399}', '\u{0661}', '\u{1e8c7}', '\u{1d6ea}', '\u{1ee00}', '\u{2d4f}', '\u{0049}', '\u{ff29}', '\u{2113}', '\u{04c0}', '\u{1028a}', '\u{1d5f9}', '\u{ff4c}', '\u{07ca}', '\u{2160}', '\u{1d4f5}', '\u{1d695}', '\u{1d724}', '\u{01c0}', '\u{1d591}', '\u{1d5a8}', '\u{1d425}', '\u{1d678}', '\u{10309}', '\u{1d610}', '\u{06f1}', '\u{ffe8}', '\u{1d62d}', '\u{1d540}', '\u{217c}', '\u{1d529}', '\u{05df}', '\u{1d7cf}', '\u{1ee80}', '\u{1d4c1}', '\u{006c}', '\u{1d4d8}', '\u{2c92}', '\u{1d7d9}', '\u{2111}', '\u{1d5c5}', '\u{a4f2}', '\u{1d7f7}', '\u{2110}', '\u{1d6b0}', '\u{1d75e}', '\u{0406}', '\u{05d5}', '\u{fe8e}', '\u{ff11}', '\u{1d43c}', '\u{fe8d}']);

Callers 1

DataTests.jsFile · 0.70

Calls 1

searchMethod · 0.80

Tested by

no test coverage detected