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

Function check

javascript/tests/js/tests/DataTests.js:2–12  ·  view source on GitHub ↗
(targetChar, homoglyphs)

Source from the content-addressed store, hash-verified

1describe("Homoglyph Search - Data Tests", function () {
2 function check(targetChar, homoglyphs){
3 describe("Homoglyphs of '" + targetChar + "'", function(){
4 homoglyphs.forEach(function (c) {
5 it("Checking '" + c + "'", function () {
6 var textContainingHomoglyph = 'xx' + c + 'xx',
7 targetWord = 'xx' + targetChar + 'xx';
8 expect(search(textContainingHomoglyph, [targetWord])).toEqual([{match: textContainingHomoglyph, word: targetWord, index: 0}]);
9 })
10 });
11 })
12 }
13
14 check("a", ["\u{1d736}" ,"\u{237a}" ,"\u{1d6c2}" ,"\u{1d41a}" ,"\u{1d4ea}" ,"\u{1d656}" ,"\u{03b1}" ,"\u{0430}" ,"\u{1d5ba}" ,"\u{0061}" ,"\u{1d5ee}" ,"\u{0251}" ,"\u{1d6fc}" ,"\u{ff41}" ,"\u{1d770}" ,"\u{1d622}" ,"\u{1d44e}" ,"\u{1d586}" ,"\u{1d51e}" ,"\u{1d68a}" ,"\u{1d482}" ,"\u{1d552}" ,"\u{1d7aa}" ,"\u{1d4b6}"]);
15 check("b", ["\u{0062}" ,"\u{15af}" ,"\u{1d41b}" ,"\u{0184}" ,"\u{1d51f}" ,"\u{1d553}" ,"\u{1d587}" ,"\u{1d5ef}" ,"\u{1d483}" ,"\u{1d623}" ,"\u{1472}" ,"\u{13cf}" ,"\u{ff42}" ,"\u{1d4b7}" ,"\u{1d4eb}" ,"\u{1d68b}" ,"\u{1d5bb}" ,"\u{1d44f}" ,"\u{042c}" ,"\u{1d657}"]);

Callers 1

DataTests.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected