local c=script.Parent local e=c.Parent local Q=require(e.MainModule)do print("\084\101\115\116\105\110\103\058 \076\065\046\083\116\114\105\110\103")local c=" \116\104\105\115 \105\115 \097 \116\101\115\116 \111\102 \097 \099\111\109\112\108\101\120\044 \097\110\100 \119\101\108\108 \100\101\115\105\103\110\101\100 \115\116\114\105\110\103\046 \087\101\108\108 \116\104\097\116\'\115 \119\104\097\116 \073 \116\104\105\110\107 \097\116 \108\101\097\115\116\046 \072\101\121 \108\111\111\107\044 \097\110\111\116\104\101\114 \099\111\109\109\097\033 "do print("\084\101\115\116\105\110\103\058 \076\065\046\083\116\114\105\110\103\046\114\101\112\108\105\099\097\116\101")local e=Q.String.replicate(c,0)assert(e==c,"\070\097\105\108\101\100 \116\111 \114\101\112\108\105\099\097\116\101 \115\116\114\105\110\103 \048 \116\105\109\101\115")local l=Q.String.replicate(c,1)assert(l==c..c,"\070\097\105\108\101\100 \116\111 \114\101\112\108\105\099\097\116\101 \115\116\114\105\110\103 \049 \116\105\109\101")local k=Q.String.replicate(c,2)assert(k==c..(c..c),"\070\097\105\108\101\100 \116\111 \114\101\112\108\105\099\097\116\101 \115\116\114\105\110\103 \050 \116\105\109\101\115")end do print("\084\101\115\116\105\110\103\058 \076\065\046\083\116\114\105\110\103\046\114\101\118\101\114\115\101")local e=Q.String.reverse(c)local l=""for e=#c,1,-1 do l=l..string.sub(c,e,e)end assert(e==l,"\070\097\105\108\101\100 \116\111 \114\101\118\101\114\115\101 \115\116\114\105\110\103")end do print("\084\101\115\116\105\110\103\058 \076\065\046\083\116\114\105\110\103\046\116\114\105\109")local e=Q.String.trim(c)local l=c:gsub("\094\037\115\042\040\046-\041\037\115\042\036","\037\049")assert(e==l,"\070\097\105\108\101\100 \116\111 \116\114\105\109 \115\116\114\105\110\103")end do print("\084\101\115\116\105\110\103\058 \076\065\046\083\116\114\105\110\103\046\099\104\097\114\065\116")local e=string.sub(c,5,5)local l=Q.String.charAt(c,5)assert(l==e,"\070\097\105\108\101\100 \116\111 \114\101\116\114\105\101\118\101 \099\104\097\114 \102\114\111\109 \105\110\100\101\120 \053 \105\110 \115\116\114\105\110\103")local k=string.sub(c,-5,-5)local d=Q.String.charAt(c,-5)assert(d==k,"\070\097\105\108\101\100 \116\111 \114\101\116\114\105\101\118\101 \099\104\097\114 \102\114\111\109 \105\110\100\101\120 -\053 \105\110 \115\116\114\105\110\103")end do print("\084\101\115\116\105\110\103\058 \076\065\046\083\116\114\105\110\103\046\099\104\097\114\067\111\100\101\065\116")local e=string.byte(string.sub(c,5,5))local l=Q.String.charCodeAt(c,5)assert(l==e,"\070\097\105\108\101\100 \116\111 \114\101\116\114\105\101\118\101 \099\104\097\114 \099\111\100\101 \102\114\111\109 \105\110\100\101\120 \053 \105\110 \115\116\114\105\110\103")local k=string.byte(string.sub(c,-5,-5))local d=Q.String.charCodeAt(c,-5)assert(d==k,"\070\097\105\108\101\100 \116\111 \114\101\116\114\105\101\118\101 \099\104\097\114 \099\111\100\101 \102\114\111\109 \105\110\100\101\120 -\053 \105\110 \115\116\114\105\110\103")end do print("\084\101\115\116\105\110\103\058 \076\065\046\083\116\114\105\110\103\046\115\112\108\105\116")local c="\097\044\098\044\099\044\116\101\115\116\044\049\044\050\044\051"local e={"\097";"\098";"\099";"\116\101\115\116";"\049","\050","\051"}local l=Q.String.split(c,"\044")for c,Q in ipairs(l)do assert(Q==e[c],"\070\097\105\108\101\100 \116\111 \115\112\108\105\116 \115\116\114\105\110\103 \097\116 \105\110\100\101\120\058 "..tostring(c))end end end do print("\084\101\115\116\105\110\103\058 \076\065\046\084\097\098\108\101")local c={"\097";"\098";"\099","\100","\101";"\102";"\103","\104";"\105";"\106"}local e={1,2;3;4;5;6;7,8;9,10}local l={"\097",1,"\098",2;"\099",3;"\100",4,"\101";5}do print("\084\101\115\116\105\110\103\058 \076\065\046\084\097\098\108\101\046\099\108\111\110\101")local k=Q.Table.clone(c)local d=Q.Table.clone(e)local O=Q.Table.clone(l)for c,e in ipairs(c)do assert(e==k[c],"\070\097\105\108\101\100 \116\111 \099\108\111\110\101 \115\116\114\105\110\103 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(c))end for c,e in ipairs(e)do assert(e==d[c],"\070\097\105\108\101\100 \116\111 \099\108\111\110\101 \110\117\109\098\101\114 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(c))end for c,e in ipairs(l)do assert(e==O[c],"\070\097\105\108\101\100 \116\111 \099\108\111\110\101 \109\105\120\101\100 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(c))end end do print("\084\101\115\116\105\110\103\058 \076\065\046\084\097\098\108\101\046\106\111\105\110")assert(Q.Table.join(c,"\044")=="\097\044\098\044\099\044\100\044\101\044\102\044\103\044\104\044\105\044\106","\070\097\105\108\101\100 \116\111 \106\111\105\110 \115\116\114\105\110\103 \116\097\098\108\101 \117\115\105\110\103 \099\111\109\109\097\115")assert(Q.Table.join(e,"\044")=="\049\044\050\044\051\044\052\044\053\044\054\044\055\044\056\044\057\044\049\048","\070\097\105\108\101\100 \116\111 \106\111\105\110 \110\117\109\098\101\114 \116\097\098\108\101 \117\115\105\110\103 \099\111\109\109\097\115")assert(Q.Table.join(l,"\044")=="\097\044\049\044\098\044\050\044\099\044\051\044\100\044\052\044\101\044\053","\070\097\105\108\101\100 \116\111 \106\111\105\110 \109\105\120\101\100 \116\097\098\108\101 \117\115\105\110\103 \099\111\109\109\097\115")end do print("\084\101\115\116\105\110\103\058 \076\065\046\084\097\098\108\101\046\115\108\105\099\101")local k=2 local d=7 local O=Q.Table.slice(c,k,d)local b=Q.Table.slice(e,k,d)local F=Q.Table.slice(l,k,d)for e,Q in ipairs(O)do assert(Q==c[(e+k)-1],"\070\097\105\108\101\100 \116\111 \115\108\105\099\101 \115\116\114\105\110\103 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(e))end for c,Q in ipairs(b)do assert(Q==e[(c+k)-1],"\070\097\105\108\101\100 \116\111 \115\108\105\099\101 \110\117\109\098\101\114 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(c))end for c,e in ipairs(F)do assert(e==l[(c+k)-1],"\070\097\105\108\101\100 \116\111 \115\108\105\099\101 \109\105\120\101\100 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(c))end end do print("\084\101\115\116\105\110\103\058 \076\065\046\084\097\098\108\101\046\109\097\112")local function k(c)if type(c)=="\110\117\109\098\101\114"then return c*2 else return tostring(c)..tostring(c)end end local d=Q.Table.map(c,k)local O=Q.Table.map(e,k)local b=Q.Table.map(l,k)for e,Q in ipairs(d)do assert(Q==k(c[e]),"\070\097\105\108\101\100 \116\111 \109\097\112 \115\116\114\105\110\103 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(e))end for c,Q in ipairs(O)do assert(Q==k(e[c]),"\070\097\105\108\101\100 \116\111 \109\097\112 \110\117\109\098\101\114 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(c))end for c,e in ipairs(b)do assert(e==k(l[c]),"\070\097\105\108\101\100 \116\111 \109\097\112 \109\105\120\101\100 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(c))end end do print("\084\101\115\116\105\110\103\058 \076\065\046\084\097\098\108\101\046\114\101\100\117\099\101")local function k(c,e)if type(c)=="\110\117\109\098\101\114"then return c+e else return c..tostring(e)end end local d=Q.Table.reduce(c,k,"")local O=Q.Table.reduce(e,k,0)local b=Q.Table.reduce(l,k,"")assert(type(d)=="\115\116\114\105\110\103","\070\097\105\108\101\100 \116\111 \114\101\100\117\099\101 \115\116\114\105\110\103 \116\097\098\108\101")assert(type(O)=="\110\117\109\098\101\114","\070\097\105\108\101\100 \116\111 \114\101\100\117\099\101 \110\117\109\098\101\114 \116\097\098\108\101")assert(type(b)=="\115\116\114\105\110\103","\070\097\105\108\101\100 \116\111 \114\101\100\117\099\101 \109\105\120\101\100 \116\097\098\108\101")end do print("\084\101\115\116\105\110\103\058 \076\065\046\084\097\098\108\101\046\102\111\114\069\097\099\104")local function k(c)if type(c)=="\110\117\109\098\101\114"then return c*2 else return tostring(c)..tostring(c)end end local d=Q.Table.forEach(c,k)local O=Q.Table.forEach(e,k)local b=Q.Table.forEach(l,k)for e,Q in ipairs(d)do assert(Q==k(c[e]),"\070\097\105\108\101\100 \116\111 \102\111\114\069\097\099\104 \115\116\114\105\110\103 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(e))end for c,Q in ipairs(O)do assert(Q==k(e[c]),"\070\097\105\108\101\100 \116\111 \102\111\114\069\097\099\104 \110\117\109\098\101\114 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(c))end for c,e in ipairs(b)do assert(e==k(l[c]),"\070\097\105\108\101\100 \116\111 \102\111\114\069\097\099\104 \109\105\120\101\100 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(c))end end do print("\084\101\115\116\105\110\103\058 \076\065\046\084\097\098\108\101\046\105\110\099\108\117\100\101\115")local k=2 local d=c[k]local O=e[k]local b=l[k]assert(Q.Table.includes(c,d),"\070\097\105\108\101\100 \116\111 \102\105\110\100 \115\116\114\105\110\103 \116\097\098\108\101 \105\116\101\109")assert(Q.Table.includes(e,O),"\070\097\105\108\101\100 \116\111 \102\105\110\100 \110\117\109\098\101\114 \116\097\098\108\101 \105\116\101\109")assert(Q.Table.includes(l,b),"\070\097\105\108\101\100 \116\111 \102\105\110\100 \109\105\120\101\100 \116\097\098\108\101 \105\116\101\109")end do print("\084\101\115\116\105\110\103\058 \076\065\046\084\097\098\108\101\046\102\105\110\100")local k=2 local d=c[k]local O=e[k]local b=l[k]local F=Q.Table.find(c,function(c)return c==d end)local i=Q.Table.find(e,function(c)return c==O end)local y=Q.Table.find(l,function(c)return c==b end)assert(F==d,"\070\097\105\108\101\100 \116\111 \102\105\110\100 \115\116\114\105\110\103 \116\097\098\108\101 \105\116\101\109")assert(i==O,"\070\097\105\108\101\100 \116\111 \102\105\110\100 \110\117\109\098\101\114 \116\097\098\108\101 \105\116\101\109")assert(y==b,"\070\097\105\108\101\100 \116\111 \102\105\110\100 \109\105\120\101\100 \116\097\098\108\101 \105\116\101\109")end do print("\084\101\115\116\105\110\103\058 \076\065\046\084\097\098\108\101\046\102\105\108\116\101\114")local c=Q.Table.filter(l,function(c)return type(c)=="\115\116\114\105\110\103"end)for c,e in ipairs(c)do assert(type(e)=="\115\116\114\105\110\103","\070\097\105\108\101\100 \116\111 \102\105\108\116\101\114 \109\105\120\101\100 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(c))end end do print("\084\101\115\116\105\110\103\058 \076\065\046\084\097\098\108\101\046\114\101\118\101\114\115\101")local k=Q.Table.reverse(c)local d=Q.Table.reverse(e)local O=Q.Table.reverse(l)for e,Q in ipairs(k)do assert(Q==c[(#c-e)+1],"\070\097\105\108\101\100 \116\111 \114\101\118\101\114\115\101 \115\116\114\105\110\103 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(e))end for c,Q in ipairs(d)do assert(Q==e[(#e-c)+1],"\070\097\105\108\101\100 \116\111 \114\101\118\101\114\115\101 \110\117\109\098\101\114 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(c))end for c,e in ipairs(O)do assert(e==l[(#l-c)+1],"\070\097\105\108\101\100 \116\111 \114\101\118\101\114\115\101 \109\105\120\101\100 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(c))end end do print("\084\101\115\116\105\110\103\058 \076\065\046\084\097\098\108\101\046\112\114\101\112\101\110\100")local k={"\110\105\099\101","\116\101\115\116"}local d={60,9}local O={69;"\116\101\115\116"}local b=Q.Table.prepend(k,c)local F=Q.Table.prepend(d,e)local i=Q.Table.prepend(O,l)for e,Q in ipairs(b)do assert(Q==c[e+#k],"\070\097\105\108\101\100 \116\111 \112\114\101\112\101\110\100 \115\116\114\105\110\103 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(e))end for c,Q in ipairs(F)do assert(Q==e[c+#d],"\070\097\105\108\101\100 \116\111 \112\114\101\112\101\110\100 \110\117\109\098\101\114 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(c))end for c,e in ipairs(i)do assert(e==l[c+#O],"\070\097\105\108\101\100 \116\111 \112\114\101\112\101\110\100 \109\105\120\101\100 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(c))end end do print("\084\101\115\116\105\110\103\058 \076\065\046\084\097\098\108\101\046\097\112\112\101\110\100")local k={"\110\105\099\101";"\116\101\115\116"}local d={60;9}local O={69,"\116\101\115\116"}local b=Q.Table.append(c,k)local F=Q.Table.append(e,d)local i=Q.Table.append(l,O)for e,Q in ipairs(b)do assert(Q==c[e],"\070\097\105\108\101\100 \116\111 \097\112\112\101\110\100 \115\116\114\105\110\103 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(e))if e>#c then assert(Q==k[e-#c],"\070\097\105\108\101\100 \116\111 \097\112\112\101\110\100 \115\116\114\105\110\103 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(e))end end for c,Q in ipairs(F)do assert(Q==e[c],"\070\097\105\108\101\100 \116\111 \097\112\112\101\110\100 \110\117\109\098\101\114 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(c))if c>#e then assert(Q==d[c-#e],"\070\097\105\108\101\100 \116\111 \097\112\112\101\110\100 \110\117\109\098\101\114 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(c))end end for c,e in ipairs(i)do assert(e==l[c],"\070\097\105\108\101\100 \116\111 \097\112\112\101\110\100 \109\105\120\101\100 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(c))if c>#l then assert(e==O[c-#l],"\070\097\105\108\101\100 \116\111 \097\112\112\101\110\100 \109\105\120\101\100 \116\097\098\108\101\044 \116\101\115\116 \102\097\105\108\101\100 \097\116 \105\110\100\101\120\058 "..tostring(c))end end end end do print("\084\101\115\116\105\110\103\058 \076\065\046\085\116\105\108\105\116\121")do print("\084\101\115\116\105\110\103 \076\065\046\085\116\105\108\105\116\121\046\115\119\105\116\099\104")local c="\099\097\115\101\095\050"local e="\121"local l=Q.Utility.switch(c,{case_1=function()return"\120"end,case_2=function()return e end;case_3=function()return"\122"end},true)assert(l==e,"\070\097\105\108\101\100\058 "..(tostring(l)..(" \115\104\111\117\108\100 \098\101 \101\113\117\097\108 \116\111 "..tostring(e))))end end do print("\084\101\115\116\105\110\103\058 \076\065\046\078\117\109\098\101\114")local c=5 local e=10 do print("\084\101\115\116\105\110\103\058 \076\065\046\078\117\109\098\101\114\046\105\115\079\100\100\040\041 \119\105\116\104 \097\110 \111\100\100 \110\117\109\098\101\114")local e=Q.Number.isOdd(c)assert(e==true,"\070\097\105\108\101\100\058 "..(c.." \105\115 \097\110 \111\100\100 \110\117\109\098\101\114"))end do print("\084\101\115\116\105\110\103\058 \076\065\046\078\117\109\098\101\114\046\105\115\079\100\100\040\041 \119\105\116\104 \097\110 \101\118\101\110 \110\117\109\098\101\114")local c=Q.Number.isOdd(e)assert(c==false,"\070\097\105\108\101\100\058 "..(e.." \105\115 \110\111\116 \097\110 \111\100\100 \110\117\109\098\101\114"))end do print("\084\101\115\116\105\110\103\058 \076\065\046\078\117\109\098\101\114\046\105\115\069\118\101\110\040\041 \119\105\116\104 \097\110 \101\118\101\110 \110\117\109\098\101\114")local c=Q.Number.isEven(e)assert(c==true,"\070\097\105\108\101\100\058 "..(e.." \105\115 \097\110 \101\118\101\110 \110\117\109\098\101\114"))end do print("\084\101\115\116\105\110\103\058 \076\065\046\078\117\109\098\101\114\046\105\115\069\118\101\110\040\041 \119\105\116\104 \097\110 \111\100\100 \110\117\109\098\101\114")local e=Q.Number.isEven(c)assert(e==false,"\070\097\105\108\101\100\058 "..(c.." \105\115 \110\111\116 \097\110 \101\118\101\110 \110\117\109\098\101\114"))end end do print("\084\101\115\116\105\110\103\058 \076\065\046\073\110\116\101\103\101\114")do print("\084\101\115\116\105\110\103\058 \076\065\046\073\110\116\101\103\101\114\046\100\105\118\105\100\101")local c=10 local e=3 local l=3 local k=4 local d,O=Q.Integer.divide(c,e)assert(d==l,"\070\097\105\108\101\100\058 "..(tostring(c)..(" \047 "..(tostring(e)..(" \115\104\111\117\108\100 \112\114\111\100\117\099\101 \097 \109\105\110\105\109\117\109 \113\117\111\116\105\101\110\116 \111\102 "..tostring(l))))))assert(O==k,"\070\097\105\108\101\100\058 "..(tostring(c)..(" \047 "..(tostring(e)..(" \115\104\111\117\108\100 \112\114\111\100\117\099\101 \097 \109\097\120\105\109\117\109 \113\117\111\116\105\101\110\116 \111\102 "..tostring(k))))))end end do print("\084\101\115\116\105\110\103\058 \076\065\046\067\111\108\111\114")local c=255 local e=0 local l=0 local k=tostring(c)..("\044 "..(tostring(e)..("\044 "..tostring(l))))local d=0 local O=1 local b=1 local F=tostring(d)..("\044 "..(tostring(O)..("\044 "..tostring(b))))local i="\035\070\070\048\048\048\048"do print("\084\101\115\116\105\110\103\058 \076\065\046\067\111\108\111\114\046\114\103\098\084\111\072\115\118")local F,i,y=Q.Color.rgbToHsv(c,e,l)assert(F==d,"\070\097\105\108\101\100\058 "..(k..(" \115\104\111\117\108\100 \112\114\111\100\117\099\101 \097 \104\117\101 \111\102 "..tostring(d))))assert(i==O,"\070\097\105\108\101\100\058 "..(k..(" \115\104\111\117\108\100 \112\114\111\100\117\099\101 \097 \115\097\116\117\114\097\116\105\111\110 \111\102 "..tostring(O))))assert(y==b,"\070\097\105\108\101\100\058 "..(k..(" \115\104\111\117\108\100 \112\114\111\100\117\099\101 \097 \118\097\108\117\101 \111\102 "..tostring(b))))end do print("\084\101\115\116\105\110\103\058 \076\065\046\067\111\108\111\114\046\114\103\098\084\111\072\101\120")local d=Q.Color.rgbToHex(c,e,l)assert(d==i,"\070\097\105\108\101\100\058 "..(k..(" \115\104\111\117\108\100 \112\114\111\100\117\099\101 \097 \104\101\120 \115\116\114\105\110\103 \111\102 "..i)))end do print("\084\101\115\116\105\110\103\058 \076\065\046\067\111\108\111\114\046\104\115\118\084\111\082\103\098")local k,i,y=Q.Color.hsvToRgb(d,O,b)assert(k==c,"\070\097\105\108\101\100\058 "..(F..(" \115\104\111\117\108\100 \112\114\111\100\117\099\101 \097 \114\101\100 \118\097\108\117\101 \111\102 "..tostring(c))))assert(i==e,"\070\097\105\108\101\100\058 "..(F..(" \115\104\111\117\108\100 \112\114\111\100\117\099\101 \097 \103\114\101\101\110 \118\097\108\117\101 \111\102 "..tostring(e))))assert(y==l,"\070\097\105\108\101\100\058 "..(F..(" \115\104\111\117\108\100 \112\114\111\100\117\099\101 \097 \098\108\117\101 \118\097\108\117\101 \111\102 "..tostring(l))))end do print("\084\101\115\116\105\110\103\058 \076\065\046\067\111\108\111\114\046\104\115\118\084\111\072\101\120")local c=Q.Color.hsvToHex(d,O,b)assert(c==i,"\070\097\105\108\101\100\058 "..(F..(" \115\104\111\117\108\100 \112\114\111\100\117\099\101 \097 \104\101\120 \115\116\114\105\110\103 \111\102 "..i)))end do print("\084\101\115\116\105\110\103\058 \076\065\046\067\111\108\111\114\046\104\101\120\084\111\082\103\098")local k,d,O=Q.Color.hexToRgb(i)assert(k==c,"\070\097\105\108\101\100\058 "..(i..(" \115\104\111\117\108\100 \112\114\111\100\117\099\101 \097 \114\101\100 \118\097\108\117\101 \111\102 "..tostring(c))))assert(d==e,"\070\097\105\108\101\100\058 "..(i..(" \115\104\111\117\108\100 \112\114\111\100\117\099\101 \097 \103\114\101\101\110 \118\097\108\117\101 \111\102 "..tostring(e))))assert(O==l,"\070\097\105\108\101\100\058 "..(i..(" \115\104\111\117\108\100 \112\114\111\100\117\099\101 \097 \098\108\117\101 \118\097\108\117\101 \111\102 "..tostring(l))))end do print("\084\101\115\116\105\110\103\058 \076\065\046\067\111\108\111\114\046\104\101\120\084\111\072\115\118")local c,e,l=Q.Color.hexToHsv(i)assert(c==d,"\070\097\105\108\101\100\058 "..(i..(" \115\104\111\117\108\100 \112\114\111\100\117\099\101 \097 \104\117\101 \111\102 "..tostring(d))))assert(e==O,"\070\097\105\108\101\100\058 "..(i..(" \115\104\111\117\108\100 \112\114\111\100\117\099\101 \097 \115\097\116\117\114\097\116\105\111\110 \111\102 "..tostring(O))))assert(l==b,"\070\097\105\108\101\100\058 "..(i..(" \115\104\111\117\108\100 \112\114\111\100\117\099\101 \097 \118\097\108\117\101 \111\102 "..tostring(b))))end end
----------------------------------------------------------------
--[[             Copyright (C) Inertia Lighting             ]]--
----------------------------------------------------------------

local testsFolder = script.Parent
local rootFolder = testsFolder.Parent

local LA = require(rootFolder.MainModule)

----------------------------------------------------------------

------------
-- LA.String
------------

do
    print("Testing: LA.String")

    local testString = " this is a test of a complex, and well designed string. Well that's what I think at least. Hey look, another comma! "

    do
        print("Testing: LA.String.replicate")

        local testStringReplicatedZeroTimes = LA.String.replicate(testString, 0)
        assert(testStringReplicatedZeroTimes == testString, "Failed to replicate string 0 times")

        local testStringReplicatedOnce = LA.String.replicate(testString, 1)
        assert(testStringReplicatedOnce == testString .. testString, "Failed to replicate string 1 time")

        local testStringReplicatedTwice = LA.String.replicate(testString, 2)
        assert(testStringReplicatedTwice == testString .. testString .. testString, "Failed to replicate string 2 times")
    end

    do
        print("Testing: LA.String.reverse")

        local testStringReversed = LA.String.reverse(testString)

        local testStringReversedReference = ""
        for i = #testString, 1, -1 do
            testStringReversedReference = testStringReversedReference .. string.sub(testString, i, i)
        end

        assert(testStringReversed == testStringReversedReference, "Failed to reverse string")
    end

    do
        print("Testing: LA.String.trim")

        local testStringTrimmed = LA.String.trim(testString)

        local testStringTrimmedReference = testString:gsub("^%s*(.-)%s*$", "%1")

        assert(testStringTrimmed == testStringTrimmedReference, "Failed to trim string")
    end

    do
        print("Testing: LA.String.charAt")

        local testStringCharAtPositive5Reference = string.sub(testString, 5, 5)
        local testStringCharAtPositive5 = LA.String.charAt(testString, 5)
        assert(testStringCharAtPositive5 == testStringCharAtPositive5Reference, "Failed to retrieve char from index 5 in string")

        local testStringCharAtNegative5Reference = string.sub(testString, -5, -5)
        local testStringCharAtNegative5 = LA.String.charAt(testString, -5)
        assert(testStringCharAtNegative5 == testStringCharAtNegative5Reference, "Failed to retrieve char from index -5 in string")
    end

    do
        print("Testing: LA.String.charCodeAt")

        local testStringCharCodeAtPositive5Reference = string.byte(string.sub(testString, 5, 5))
        local testStringCharCodeAtPositive5 = LA.String.charCodeAt(testString, 5)
        assert(testStringCharCodeAtPositive5 == testStringCharCodeAtPositive5Reference, "Failed to retrieve char code from index 5 in string")

        local testStringCharCodeAtNegative5Reference = string.byte(string.sub(testString, -5, -5))
        local testStringCharCodeAtNegative5 = LA.String.charCodeAt(testString, -5)
        assert(testStringCharCodeAtNegative5 == testStringCharCodeAtNegative5Reference, "Failed to retrieve char code from index -5 in string")
    end

    do
        print("Testing: LA.String.split")

        local testStringSplitReferenceString = "a,b,c,test,1,2,3"
        local testStringSplitReferenceTable = {"a", "b", "c", "test", "1", "2", "3"}

        local testStringSplitString = LA.String.split(testStringSplitReferenceString, ",")

        for i, v in ipairs(testStringSplitString) do
            assert(v == testStringSplitReferenceTable[i], "Failed to split string at index: " .. tostring(i))
        end
    end
end

-----------
-- LA.Table
-----------

do
    print("Testing: LA.Table")

    local stringTable = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"}
    local numberTable = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
    local mixedTable = {"a", 1, "b", 2, "c", 3, "d", 4, "e", 5}

    do
        print("Testing: LA.Table.clone")

        local clonedStringTable = LA.Table.clone(stringTable)
        local clonedNumberTable = LA.Table.clone(numberTable)
        local clonedMixedTable = LA.Table.clone(mixedTable)

        for i, v in ipairs(stringTable) do
            assert(v == clonedStringTable[i], "Failed to clone string table, test failed at index: " .. tostring(i))
        end

        for i, v in ipairs(numberTable) do
            assert(v == clonedNumberTable[i], "Failed to clone number table, test failed at index: " .. tostring(i))
        end

        for i, v in ipairs(mixedTable) do
            assert(v == clonedMixedTable[i], "Failed to clone mixed table, test failed at index: " .. tostring(i))
        end
    end

    do
        print("Testing: LA.Table.join")

        assert(LA.Table.join(stringTable, ",") == "a,b,c,d,e,f,g,h,i,j", "Failed to join string table using commas")
        assert(LA.Table.join(numberTable, ",") == "1,2,3,4,5,6,7,8,9,10", "Failed to join number table using commas")
        assert(LA.Table.join(mixedTable, ",") == "a,1,b,2,c,3,d,4,e,5", "Failed to join mixed table using commas")
    end

    do
        print("Testing: LA.Table.slice")

        local startIndex = 2
        local endIndex = 7

        local slicedStringTable = LA.Table.slice(stringTable, startIndex, endIndex)
        local slicedNumberTable = LA.Table.slice(numberTable, startIndex, endIndex)
        local slicedMixedTable = LA.Table.slice(mixedTable, startIndex, endIndex)

        for i, v in ipairs(slicedStringTable) do
            assert(v == stringTable[i + startIndex - 1], "Failed to slice string table, test failed at index: " .. tostring(i))
        end

        for i, v in ipairs(slicedNumberTable) do
            assert(v == numberTable[i + startIndex - 1], "Failed to slice number table, test failed at index: " .. tostring(i))
        end

        for i, v in ipairs(slicedMixedTable) do
            assert(v == mixedTable[i + startIndex - 1], "Failed to slice mixed table, test failed at index: " .. tostring(i))
        end
    end

    do
        print("Testing: LA.Table.map")

        local function mapFunction(value)
            if type(value) == "number" then
                return value * 2
            else
                return tostring(value) .. tostring(value)
            end
        end

        local mappedStringTable = LA.Table.map(stringTable, mapFunction)
        local mappedNumberTable = LA.Table.map(numberTable, mapFunction)
        local mappedMixedTable = LA.Table.map(mixedTable, mapFunction)

        for i, v in ipairs(mappedStringTable) do
            assert(v == mapFunction(stringTable[i]), "Failed to map string table, test failed at index: " .. tostring(i))
        end

        for i, v in ipairs(mappedNumberTable) do
            assert(v == mapFunction(numberTable[i]), "Failed to map number table, test failed at index: " .. tostring(i))
        end

        for i, v in ipairs(mappedMixedTable) do
            assert(v == mapFunction(mixedTable[i]), "Failed to map mixed table, test failed at index: " .. tostring(i))
        end
    end

    do
        print("Testing: LA.Table.reduce")

        local function reduceFunction(accumulator, value)
            if type(accumulator) == "number" then
                return accumulator + value
            else
                return accumulator .. tostring(value)
            end
        end

        local reducedStringTable = LA.Table.reduce(stringTable, reduceFunction, "")
        local reducedNumberTable = LA.Table.reduce(numberTable, reduceFunction, 0)
        local reducedMixedTable = LA.Table.reduce(mixedTable, reduceFunction, "")

        assert(type(reducedStringTable) == "string", "Failed to reduce string table")
        assert(type(reducedNumberTable) == "number", "Failed to reduce number table")
        assert(type(reducedMixedTable) == "string", "Failed to reduce mixed table")
    end

    do
        print("Testing: LA.Table.forEach")

        local function forEachFunction(value)
            if type(value) == "number" then
                return value * 2
            else
                return tostring(value) .. tostring(value)
            end
        end

        local forEachStringTable = LA.Table.forEach(stringTable, forEachFunction)
        local forEachNumberTable = LA.Table.forEach(numberTable, forEachFunction)
        local forEachMixedTable = LA.Table.forEach(mixedTable, forEachFunction)

        for i, v in ipairs(forEachStringTable) do
            assert(v == forEachFunction(stringTable[i]), "Failed to forEach string table, test failed at index: " .. tostring(i))
        end

        for i, v in ipairs(forEachNumberTable) do
            assert(v == forEachFunction(numberTable[i]), "Failed to forEach number table, test failed at index: " .. tostring(i))
        end

        for i, v in ipairs(forEachMixedTable) do
            assert(v == forEachFunction(mixedTable[i]), "Failed to forEach mixed table, test failed at index: " .. tostring(i))
        end
    end

    do
        print("Testing: LA.Table.includes")

        local itemIndex = 2

        local stringTableItem = stringTable[itemIndex]
        local numberTableItem = numberTable[itemIndex]
        local mixedTableItem = mixedTable[itemIndex]

        assert(LA.Table.includes(stringTable, stringTableItem), "Failed to find string table item")
        assert(LA.Table.includes(numberTable, numberTableItem), "Failed to find number table item")
        assert(LA.Table.includes(mixedTable, mixedTableItem), "Failed to find mixed table item")
    end

    do
        print("Testing: LA.Table.find")

        local itemIndex = 2

        local stringTableItem = stringTable[itemIndex]
        local numberTableItem = numberTable[itemIndex]
        local mixedTableItem = mixedTable[itemIndex]

        local foundStringTableItem = LA.Table.find(stringTable, function(value)
            return value == stringTableItem
        end)
        local foundNumberTableItem = LA.Table.find(numberTable, function(value)
            return value == numberTableItem
        end)
        local foundMixedTableItem = LA.Table.find(mixedTable, function(value)
            return value == mixedTableItem
        end)

        assert(foundStringTableItem == stringTableItem, "Failed to find string table item")
        assert(foundNumberTableItem == numberTableItem, "Failed to find number table item")
        assert(foundMixedTableItem == mixedTableItem, "Failed to find mixed table item")
    end

    do
        print("Testing: LA.Table.filter")

        local filteredMixedTable = LA.Table.filter(mixedTable, function(value)
            return type(value) == "string"
        end)

        for i, v in ipairs(filteredMixedTable) do
            assert(type(v) == "string", "Failed to filter mixed table, test failed at index: " .. tostring(i))
        end
    end

    do
        print("Testing: LA.Table.reverse")

        local reversedStringTable = LA.Table.reverse(stringTable)
        local reversedNumberTable = LA.Table.reverse(numberTable)
        local reversedMixedTable = LA.Table.reverse(mixedTable)

        for i, v in ipairs(reversedStringTable) do
            assert(v == stringTable[#stringTable - i + 1], "Failed to reverse string table, test failed at index: " .. tostring(i))
        end

        for i, v in ipairs(reversedNumberTable) do
            assert(v == numberTable[#numberTable - i + 1], "Failed to reverse number table, test failed at index: " .. tostring(i))
        end

        for i, v in ipairs(reversedMixedTable) do
            assert(v == mixedTable[#mixedTable - i + 1], "Failed to reverse mixed table, test failed at index: " .. tostring(i))
        end
    end

    do
        print("Testing: LA.Table.prepend")

        local tinyStringTable = {"nice", "test"}
        local tinyNumberTable = {60, 9}
        local tinyMixedTable = {69, "test"}

        local prependedStringTable = LA.Table.prepend(tinyStringTable, stringTable)
        local prependedNumberTable = LA.Table.prepend(tinyNumberTable, numberTable)
        local prependedMixedTable = LA.Table.prepend(tinyMixedTable, mixedTable)

        for i, v in ipairs(prependedStringTable) do
            assert(v == stringTable[i + #tinyStringTable], "Failed to prepend string table, test failed at index: " .. tostring(i))
        end

        for i, v in ipairs(prependedNumberTable) do
            assert(v == numberTable[i + #tinyNumberTable], "Failed to prepend number table, test failed at index: " .. tostring(i))
        end

        for i, v in ipairs(prependedMixedTable) do
            assert(v == mixedTable[i + #tinyMixedTable], "Failed to prepend mixed table, test failed at index: " .. tostring(i))
        end
    end

    do
        print("Testing: LA.Table.append")

        local tinyStringTable = {"nice", "test"}
        local tinyNumberTable = {60, 9}
        local tinyMixedTable = {69, "test"}

        local appendedStringTable = LA.Table.append(stringTable, tinyStringTable)
        local appendedNumberTable = LA.Table.append(numberTable, tinyNumberTable)
        local appendedMixedTable = LA.Table.append(mixedTable, tinyMixedTable)

        for i, v in ipairs(appendedStringTable) do
            assert(v == stringTable[i], "Failed to append string table, test failed at index: " .. tostring(i))
            if i > #stringTable then
                assert(v == tinyStringTable[i - #stringTable], "Failed to append string table, test failed at index: " .. tostring(i))
            end
        end

        for i, v in ipairs(appendedNumberTable) do
            assert(v == numberTable[i], "Failed to append number table, test failed at index: " .. tostring(i))
            if i > #numberTable then
                assert(v == tinyNumberTable[i - #numberTable], "Failed to append number table, test failed at index: " .. tostring(i))
            end
        end

        for i, v in ipairs(appendedMixedTable) do
            assert(v == mixedTable[i], "Failed to append mixed table, test failed at index: " .. tostring(i))
            if i > #mixedTable then
                assert(v == tinyMixedTable[i - #mixedTable], "Failed to append mixed table, test failed at index: " .. tostring(i))
            end
        end
    end
end

-------------
-- LA.Utility
-------------

do
    print("Testing: LA.Utility")

    do
        print("Testing LA.Utility.switch")

        local switchInputValue = "case_2"
        local switchReturnValue = "y"

        local value = LA.Utility.switch(
            switchInputValue,
            {
                ["case_1"] = function()
                    return "x"
                end,
                ["case_2"] = function()
                    return switchReturnValue
                end,
                ["case_3"] = function()
                    return "z"
                end,
            },
            true
        )

        assert(value == switchReturnValue, "Failed: " .. tostring(value) .. " should be equal to " .. tostring(switchReturnValue))
    end
end

------------
-- LA.Number
------------

do
    print("Testing: LA.Number")

    local oddNumber = 5
    local evenNumber = 10

    do
        print("Testing: LA.Number.isOdd() with an odd number")

        local isOdd = LA.Number.isOdd(oddNumber)
        assert(isOdd == true, "Failed: " .. oddNumber .. " is an odd number")
    end

    do
        print("Testing: LA.Number.isOdd() with an even number")

        local isOdd = LA.Number.isOdd(evenNumber)
        assert(isOdd == false, "Failed: " .. evenNumber .. " is not an odd number")
    end

    do
        print("Testing: LA.Number.isEven() with an even number")

        local isEven = LA.Number.isEven(evenNumber)
        assert(isEven == true, "Failed: " .. evenNumber .. " is an even number")
    end

    do
        print("Testing: LA.Number.isEven() with an odd number")

        local isEven = LA.Number.isEven(oddNumber)
        assert(isEven == false, "Failed: " .. oddNumber .. " is not an even number")
    end
end

-------------
-- LA.Integer
-------------

do
    print("Testing: LA.Integer")

    do
        print("Testing: LA.Integer.divide")

        local dividend = 10
        local divisor = 3

        local quotientMin = 3
        local quotientMax = 4

        local qMin, qMax = LA.Integer.divide(dividend, divisor)
        assert(qMin == quotientMin, "Failed: " .. tostring(dividend) .. " / " .. tostring(divisor) .. " should produce a minimum quotient of " .. tostring(quotientMin))
        assert(qMax == quotientMax, "Failed: " .. tostring(dividend) .. " / " .. tostring(divisor) .. " should produce a maximum quotient of " .. tostring(quotientMax))
    end
end

-----------
-- LA.Color
-----------

do
    print("Testing: LA.Color")

    local red = 255
    local green = 0
    local blue = 0

    local rgbString = tostring(red) .. ", " .. tostring(green) .. ", " .. tostring(blue)

    local hue = 0
    local saturation = 1
    local value = 1

    local hsvString = tostring(hue) .. ", " .. tostring(saturation) .. ", " .. tostring(value)

    local hexString = "#FF0000"

    do
        print("Testing: LA.Color.rgbToHsv")

        local h, s, v = LA.Color.rgbToHsv(red, green, blue)
        assert(h == hue, "Failed: " .. rgbString .. " should produce a hue of " .. tostring(hue))
        assert(s == saturation, "Failed: " .. rgbString .. " should produce a saturation of " .. tostring(saturation))
        assert(v == value, "Failed: " .. rgbString .. " should produce a value of " .. tostring(value))
    end

    do
        print("Testing: LA.Color.rgbToHex")

        local hex = LA.Color.rgbToHex(red, green, blue)
        assert(hex == hexString, "Failed: " .. rgbString .. " should produce a hex string of " .. hexString)
    end

    do
        print("Testing: LA.Color.hsvToRgb")

        local r, g, b = LA.Color.hsvToRgb(hue, saturation, value)
        assert(r == red, "Failed: " .. hsvString .. " should produce a red value of " .. tostring(red))
        assert(g == green, "Failed: " .. hsvString .. " should produce a green value of " .. tostring(green))
        assert(b == blue, "Failed: " .. hsvString .. " should produce a blue value of " .. tostring(blue))
    end

    do
        print("Testing: LA.Color.hsvToHex")

        local hex = LA.Color.hsvToHex(hue, saturation, value)
        assert(hex == hexString, "Failed: " .. hsvString .. " should produce a hex string of " .. hexString)
    end

    do
        print("Testing: LA.Color.hexToRgb")

        local r, g, b = LA.Color.hexToRgb(hexString)
        assert(r == red, "Failed: " .. hexString .. " should produce a red value of " .. tostring(red))
        assert(g == green, "Failed: " .. hexString .. " should produce a green value of " .. tostring(green))
        assert(b == blue, "Failed: " .. hexString .. " should produce a blue value of " .. tostring(blue))
    end

    do
        print("Testing: LA.Color.hexToHsv")

        local h, s, v = LA.Color.hexToHsv(hexString)
        assert(h == hue, "Failed: " .. hexString .. " should produce a hue of " .. tostring(hue))
        assert(s == saturation, "Failed: " .. hexString .. " should produce a saturation of " .. tostring(saturation))
        assert(v == value, "Failed: " .. hexString .. " should produce a value of " .. tostring(value))
    end
end
