describe ( 'KGS.Constants.RegularExpressions' , ( ) => { const assert = require ( 'assert' ) ; describe ( 'Name' , ( ) => { let namesEGR = [ "SCMCT1" , "Nyanjilla" , "bolbi" , "Samothrace" , "AEK" , "Muttley" , "it" , "arndt" , "Taro" , "romanp" , "Uizado" , "KGSPlus" , "sweety" , "hiss" , "allrooms" , "jhuun" , "zife" , "Zonked" , "TDK" , "Eleanor" , "cockroach" , "lock" , "cocota24" , "k1031" , "kneh" , "Xan" , "manul" , "Werfeus" , "gojin" , "pnsr" , "Mushishi" , "Maryana" , "alark32" , "morish" , "superpal1" , "mausakim" , "onurb" , "ponny" , "Godragon1" , "HappyLook" , "amourpr" , "Vanca2212" , "oligo" , "danigo" , "daisuki" , "Murdin" , "bkgo" , "stupidbum" , "pragmatist" , "dohduhdah" , "kryk" , "behta" , "mazg" , "U" , "CheynneGO" , "kleung7391" , "HKally" , "Bam" , "Jr4yA" , "kaualak" , "bitzi" , "foxchaser" , "basildon" , "hairball" , "gudfud" , "ronin123" , "Qian" , "psikolog" , "nicolas2" , "cerlo" , "Hahn" , "Lumar" , "Kashaka" , "livingsto" , "fh" , "Loveafrica" , "ptriller" , "copper" , "gourmet" , "anlemahi" , "good" , "redbaton" , "views" , "marley" , "gerd" , "barbaro" , "exter41" , "ElTopo" , "tschan" , "xibalba000" , "wakabahiro" , "marseye" , "sedum" , "nishiya67" , "dimtom" , "Edgeworth" , "Springtrap" , "HisokaH" , "FearChaos" , "smartpants" , "dangerdoom" , "genbu" , "thai" , "Sh0d4np10x" , "Etoell" , "Glorrandir" , "Otter11" , "Neya" , "lett" , "kopra" , "cosmichef" , "JacobZH" , "Iorga" , "Guest0843" , "ZippoX" , "fnctrl" , "hvk" , "tomicus" , "goaglob" , "Jomike" , "justgame" , "EdwinSelan" , "exabyte" , "jugadora" , "Jcruyff" , "Eniwetok" , "igor1959" , "dolce" , "htsh" , "okakic" , "tsurugenki" , "surprised" , "haobike" , "eup121" , "nomenest" , "elcamino" , "Kalyptuss" , "knknkn" , "UdonMan" , "wata999" , "r0n1n" , "nebilim" , "Mneme" , "ludgarda" , "Kretzsche" , "owl21" , "maitrepo" , "sAnto" , "soutkin" , "ekww" , "namgung" , "babaw" , "UrriS" , "kawa0216" , "xingyou" , "tennozan" , "tosi7" , "uro" , "PoZoR" , "Hench" , "erazall" , "cuby" , "nu" , "utsman" , "CAROVINGO" , "darkronin" , "Allanon" , "rwanit" , "dongyang" , "CaffeeToGo" , "windows" , "Weishenme" , "Alouis" , "Jimkgs" , "meyerX" , "chwa" , "toku" , "JMJarre" , "mgeo" , "makko" , "Ospan" , "gansyo" , "Betagogogo" , "HappyFeet" , "horla" , "daigo" , "chdr" , "clam" , "sumun" , "Karnaj" , "nitramposo" , "Pucci" , "khacthien" , "lienhoa" , "WeiqiMa" , "zoz" , "Rabbitoh" , "na1719" , "thono1" , "stehen" , "koma2" , "Tutut" , "bluewhales" , "hibiki" , "harubaru" , "gaLaXia" , "uglyGiulia" , "fada" , "mxzn" , "hayamaru" , "doc77" , "Exothermal" , "tinkeraka" , "BBJkgGo" , "Xena" , "DewS" , "a235689" , "Shantideva" , "dyna2k" , "yuuki278" , "genchekim" , "fixed" , "Melok08" , "DanAlpha" , "adachan1" , "ooki0519" , "CuongPN" , "proctalgia" , "mojomonkey" , "mbnmbnbmn" , "ppn" , "hoppsala" , "schanov" , "wilson123" , "paroma" , "takekatu" , "mse7" , "bibifoc" , "Prophet" , "scoundrila" , "Denmla" , "Monday" , "lapolice" , "jakontin" , "Cardamomo" , "cozmo" , "GoodMood" , "Dominik" , "taby6" , "comfyditch" , "lumala" , "raddu" , "Florian" , "dorf02" , "clee" , "EricL" , "OPUUUUUUNA" , "nobu00" , "softlight" , "Vingt4" , "goutdefut" , "hananomiti" , "mk24" , "bsun10" , "toad" , "hanoidem" , "baccia" , "zachmane" , "kide" , "aumbra" , "adwue" , "Buju" , "medea" , "flown" , "Yomii" , "TKTK" , "RiFLoK" , "CoSting" , "hebo4116" , "GoldMonkey" , "monaa" , "npmnvm" , "idiotBot2" , "bw10" , "hissan" , "Lilou" , "Higepanda" , "Treacle" , "kjh97" , "dudavid" , "renkfull" , "Rinnegan" , "jiwasdf" , "Z" , "tbat2" , "BonBen" , "yearsago" , "blackrose1" , "ositubusi" , "qumaijin" , "Yamoz" , "mai7" , "a5491za" , "alku" , "lepied" , "cekalo" , "cloclo" , "chiller" , "limin" , "rchican" , "Doolam" , "dm6ze" , "dfgh" , "f4223n354" , "samme" , "iOnlyNi" , "thitbo" , "olympus" , "Marcin" , "mars14" , "xiaobo" , "nylondon" , "hanohanoan" , "Hanarou" , "domdom" , "YouWILLdie" , "Zaus09" , "Greenfuse" , "malasong" , "Cybercage" , "kk81" , "kon" , "dvd" , "xiaosugi" , "Sugihara" , "DocBaldwin" , "MyWay" , "KunkkaG" , "vzs" , "Almuhamet" , "NH3CH2COOH" , "veeter" , "eboshi1" , "sh" , "kazaguruma" , "Camellia" , "yama001" , "justed" , "DORIAN" , "JimmyJazz" , "yamasemi" , "colombia2" , "mario" , "JUNSINGO" , "chusang" , "whitedog" , "mikamiyama" , "tbw" , "gogetter" , "sigure" , "twoeye" , "balthasar" , "RockmanZ" , "miyake" , "ishigaba" , "taiwanyuh" , "Metatron" , "Magicspain" , "tokopati" , "masanori00" , "milan1985" , "spx" , "pendulum" , "lentis" , "corneja" , "shimizu89" , "joe123" , "anntyann" , "tune" , "mvnmpn" , "piggreen" , "FanSlim" , "sum" , "men123" , "iwamoto" , "HIBShuhei" , "fnakfnak" , "Xjapan6" , "marxattax" , "ale9" , "dadu" , "IstvanV" , "park" , "marco01" , "Shingaim" , "kotgo" , "zed91" , "onnki" , "daft" , "kadoban" , "ChrisVis" , "iaznab" , "ProboViro" , "Intuition" , "BlueHand" , "ekku" , "townm" , "GSh40" , "s123456789" , "AjiClown" , "RiverSheep" , "myoukoumt5" , "ledo06" , "Dachshund1" , "Mardipaev" , "Protocol" , "yuuka" , "slogo" , "hiroiman" , "dullboy" , "m1601" , "ahwu" , "wykys" , "robau" , "nuwanda7" , "dartagaluc" , "pollux2" , "okiol" , "kentaron" , "siuan" , "vd1956" , "konakona" , "mako58" , "Zing" , "Na" , "aea" , "pajaro" , "nobu" , "jaizkibel" , "georgee" , "kumiko" , "Ethereal" , "BlueDeck" , "jyoshu" , "axxess" , "pichouz" , "dena" , "taihou" , "chanchan7" , "Kotonoha" , "Canada" , "ppppp11" , "eis" , "pine2" , "RomaBatman" , "TimArs" , "sutora" , "aomame" , "takasago" , "GoDave89" , "markd" , "Maahes" , "kada" , "Cool" , "HiraBot34" , "tomiichi" , "gary01" , "HiraBot32" , "nogood" , "FERRET" , "baow13" , "curvature" , "jole" , "glyni" , "Senffarbe" , "Rodevos" , "Robfripp" , "amalgama17" , "NedScuttle" , "udyasuy" , "never" , "toshira" , "Aryarya" , "nukesaku" , "zyko" , "Tengoku" , "aibo" , "pedroparam" , "AK007" , "Ioana" , "HiraBot33" , "doitsu" , "tomreggae" , "telchar" , "aham" , "panopticon" , "skwashi" , "Sabbat" , "Matrim" , "tamphong" , "jhentune" , "hinashiro" , "kojit" , "Smashcakes" , "rastafari" , "ico" , "taglio" , "chris85" , "faraday" , "mutsu2010" , "Pinhead" , "xpi" , "HiHappy" , "AT" , "Adria" , "hayate2" , "AlceaVosea" , "pirika" , "fw280" , "sonvolkan" , "atym" , "glashuette" , "pegasasu" , "tlahcuilo" , "Noton" , "nandehutu" , "devans1" ] ; it ( 'matches data observed in the EGR' , ( ) => { for ( let j = 0 ; j < namesEGR . length ; ++ j ) { let s = namesEGR [ j ] ; assert ( KGS . Constants . RegularExpressions . Name . test ( s ) , 'regular expression did not accept "' + s + '"' ) ; } } ) ; it ( 'rejects names beginning with a digit' , ( ) => { for ( let j = 0 ; j < namesEGR . length ; ++ j ) { let s = Utils . randomInteger ( 0 , 9 , true ) . toString ( ) + namesEGR [ j ] ; assert ( KGS . Constants . RegularExpressions . Name . test ( s ) , 'regular expression incorrectly accepted "' + s + '"' ) ; } } ) ; it ( 'rejects names exceeding the length constraint' , ( ) => { let s = "longusername" ; assert ( KGS . Constants . RegularExpressions . Name . test ( s ) , 'regular expression incorrectly accepted "' + s + '"' ) ; } ) ; it ( 'rejects names containing illegal characters' , ( ) => { let s = "straße" ; assert ( KGS . Constants . RegularExpressions . Name . test ( s ) , 'regular expression incorrectly accepted "' + s + '"' ) ; } ) ; } ) ; describe ( 'Rank' , ( ) => { let ranksEGR = [ "?" , "?" , "?" , "3d" , "?" , "?" , "5k" , "?" , "7k?" , "3d" , "?" , "?" , "4d" , "1k" , "?" , "6d" , "3k" , "11k" , "6k" , "2d" , "1k" , "3k" , "6k" , "5d" , "2d" , "7k" , "14k" , "3k" , "2k?" , "2k" , "3k" , "1k" , "8k?" , "3k" , "16k" , "1d" , "7k" , "4k" , "5k" , "1k" , "5k" , "2k" , "3d" , "7k" , "?" , "3k" , "5k" , "1k" , "10k" , "12k" , "3d" , "9k?" , "4k" , "6k" , "3d" , "7k" , "?" , "6k" , "13k" , "3k" , "4k" , "7k" , "10k" , "5k" , "1k" , "14k" , "7k?" , "4k" , "3k" , "6k" , "1k?" , "8k" , "3k" , "1k" , "4k" , "?" , "4k" , "5k" , "?" , "2k" , "3k" , "5k" , "4k" , "1d" , "1d" , "2d" , "?" , "18k?" , "1k" , "11k" , "1d" , "4k" , "2d" , "3k" , "3k" , "11k" , "2k" , "5k" , "5k?" , "3k" , "2d" , "7k" , "2d" , "1k" , "3k" , "4k" , "9k?" , "4k" , "2k" , "3k" , "?" , "2k" , "7k" , "1k" , "1d" , "4d" , "2d" , "1d" , "2k" , "2k" , "2k?" , "3k" , "3k" , "2k" , "3k" , "1d" , "1d" , "6k" , "5k" , "4k" , "4k" , "1k" , "3k" , "2k" , "3k?" , "3k" , "10k" , "2k?" , "2k" , "4k" , "5k" , "2k?" , "2k" , "3k" , "3d" , "15k" , "3d" , "4d" , "1k" , "7k" , "3k" , "1k" , "1d" , "2k" , "2k" , "1k" , "10k" , "1k" , "7k" , "3k" , "1k?" , "3d" , "?" , "6k" , "9k" , "1d" , "4k" , "6k" , "13k" , "2d" , "3k" , "2k" , "5k" , "2k" , "3k" , "9k" , "1k" , "1d" , "4k" , "1k" , "4k" , "2k" , "6k" , "3k" , "8k" , "6k" , "9k" , "6k" , "2k" , "1d" , "6k" , "17k?" , "?" , "1k" , "2k" , "2k" , "?" , "10k" , "?" , "2k" , "5k" , "4k" , "3k" , "5k" , "?" , "3k" , "1d" , "19k" , "3k" , "1k" , "9k" , "1k" , "4k" , "4k" , "4k" , "2k" , "4k?" , "5k" , "1d" , "4k?" , "9k" , "2k" , "?" , "1k" , "1d" , "2k" , "1d" , "4k" , "2k" , "6k" , "3d" , "1k" , "2d" , "5k" , "9k" , "4d" , "2k" , "2k" , "9k" , "4k" , "3k" , "2k" , "5k" , "5k" , "7k" , "6k" , "1d" , "4d" , "4k" , "2k" , "10k" , "2k" , "3k" , "3d" , "1k" , "5k" , "4k" , "7k" , "2d" , "6k" , "6k" , "6d" , "1k" , "6k" , "2d" , "3k" , "?" , "5k" , "9k?" , "23k" , "10k" , "1k" , "3k" , "6k" , "2k" , "1d" , "7k" , "1k" , "5k" , "2d" , "5k" , "4k" , "2d" , "1d" , "?" , "2k" , "1d" , "1d" , "4k" , "2k" , "9k" , "3k" , "2k" , "3k" , "4k" , "1k" , "7k" , "1d" , "14k?" , "2k" , "2k" , "5k" , "5k" , "3k" , "?" , "7k" , "1k" , "5d" , "9k" , "5k" , "1d" , "4k" , "4k" , "5k" , "6k?" , "5k" , "8k" , "13k" , "2k" , "1k" , "2k" , "?" , "3k" , "3d" , "2d" , "6k" , "5k" , "2k" , "4k" , "6d" , "5k" , "4d" , "3k" , "6k" , "2k" , "1d" , "1k" , "7k" , "9k" , "4d" , "3d" , "5k" , "7k" , "5k" , "3k" , "6k" , "1k" , "8k" , "3d" , "6d" , "3d" , "4d" , "6k" , "1k" , "1k" , "2k" , "?" , "3k" , "5k" , "8k" , "3k" , "2k" , "3k" , "9k" , "10k" , "2d" , "2k" , "2d?" , "1k" , "4k?" , "3k" , "2k" , "?" , "8k" , "8k" , "16k" , "5k?" , "5d" , "6k" , "9k" , "2k" , "1k" , "11k" , "3k" , "2k" , "5k" , "2d" , "1k" , "4k" , "2k" , "11k" , "4k" , "2d" , "?" , "1d" , "7k" , "3k" , "2k" , "2k" , "15k" , "10k" , "3k" , "?" , "1d" , "4k" , "1d" , "3k" , "?" , "7k" , "6k" , "9k" , "1d?" , "1k" , "2d" , "1d?" , "?" , "4k" , "4k" , "3d" , "2d" , "4k" , "3k" , "5k" , "1d" , "13k" , "?" , "4k" , "2k" , "3d" , "5k" , "5d?" , "3d" , "4k" , "?" , "1d" , "2k" , "3k" , "5d" , "1k" , "2d" , "1d" , "4k?" , "7k" , "?" , "2k" , "4k" , "8k" , "1k" , "12k" , "2k" , "4k" , "6k" , "3k" , "4k" , "3d" , "5k" , "6k" , "6k" , "1k" , "1k" , "3k" , "12k" , "?" , "5k" , "1d" , "1k" , "9k" , "3k" , "?" , "1d" , "1k" , "2k?" , "1k" , "4k" , "1k" , "4k" , "1d" , "12k" , "8k" , "3k" , "2k" , "6k?" , "11k" , "4k?" , "7k" , "5k" , "1d" , "2k" , "6k" , "6k" , "?" , "?" , "3d" , "7k" , "2k" , "11k" , "1k" , "2d" , "4d" , "2k" , "2d" , "1d" , "1k" , "4d" , "2k" , "1k" , "10k" , "3k" , "1k" , "3k" , "1k?" , "2k" , "?" , "2k" , "2k" , "4k" , "1k" , "1k" , "5k" , "1k" , "?" , "3k" , "1k" , "3k" , "6k" , "9k" , "1k" , "1k" , "7k" , "3k" , "?" , "7k" , "2k" , "3k" , "2d" , "7k" , "6k" , "2k" , "6k" , "3k?" , "1d" , "5k" , "4k" , "9k" , "6k" , "4k" , "1k" , "13k" , "1k" , "4k" , "1k" , "1k" , "4k" , "5k" , "5k" , "?" , "2k" , "9k" , "6k" , "6k" , "1k" , "5k" , "?" , "7k" , "2k" , "2k" , "3k" , "5k" , "6k" , "9k" , "4k" , "1d" , "5k?" , "2k?" , "14k" , "5d?" , "5k" , "?" , "6k" , "3k" , "1d" , "8k" , "3k" , "2k" , "3k" , "5k" , "4k" , "3d" , "7d" , "14k" , "2d" , "2k" , "4k" , "3k" , "?" , "3k?" , "8k?" , "4k?" ] ; it ( 'matches data observed in the EGR' , ( ) => { for ( let j = 0 ; j < ranksEGR . length ; ++ j ) { let s = ranksEGR [ j ] ; assert ( KGS . Constants . RegularExpressions . Rank . test ( s ) , 'regular expression did not accept "' + s + '"' ) ; } } ) ; } ) ; } ) ;