local Z=require("\046\046\047\101\110\100\115\087\105\116\104")local r=require("\064\112\107\103\047\064\106\115\100\111\116\108\117\097\047\106\101\115\116-\103\108\111\098\097\108\115")local s=r.expect local z=r.it z("\105\115 \116\114\117\101 \105\102 \116\104\101 \115\116\114\105\110\103 \101\110\100\115 \119\105\116\104 \116\104\101 \103\105\118\101\110 \115\117\098\115\116\114\105\110\103",function()(s(Z("\111\111\102","\111\102"))).toEqual(true)end)z("\105\115 \102\097\108\115\101 \105\102 \116\104\101 \115\116\114\105\110\103 \100\111\101\115 \110\111\116 \101\110\100 \119\105\116\104 \116\104\101 \103\105\118\101\110 \115\117\098\115\116\114\105\110\103",function()(s(Z("\111\111\102","\098"))).toEqual(false)end)z("\105\115 \102\097\108\115\101 \105\102 \116\104\101 \115\117\098\115\116\114\105\110\103 \105\115 \108\111\110\103\101\114 \116\104\097\110 \116\104\101 \115\116\114\105\110\103",function()(s(Z("\111\111\111","\111\111\111\111"))).toEqual(false)end)z("\105\115 \116\114\117\101 \105\102 \116\104\101 \115\117\098\115\116\114\105\110\103 \105\115 \101\109\112\116\121",function()(s(Z("\111\111\102",""))).toEqual(true)end)z("\105\115 \116\114\117\101 \105\102 \116\104\101 \115\117\098\115\116\114\105\110\103 \105\115 \101\109\112\116\121 \097\110\100 \116\104\101 \118\097\108\117\101 \116\111\111",function()(s(Z("",""))).toEqual(true)end)
local endsWith = require('../endsWith')

local JestGlobals = require('@pkg/@jsdotlua/jest-globals')
local expect = JestGlobals.expect
local it = JestGlobals.it

it('is true if the string ends with the given substring', function()
    expect(endsWith('oof', 'of')).toEqual(true)
end)

it('is false if the string does not end with the given substring', function()
    expect(endsWith('oof', 'b')).toEqual(false)
end)

it('is false if the substring is longer than the string', function()
    expect(endsWith('ooo', 'oooo')).toEqual(false)
end)

it('is true if the substring is empty', function()
    expect(endsWith('oof', '')).toEqual(true)
end)

it('is true if the substring is empty and the value too', function()
    expect(endsWith('', '')).toEqual(true)
end)
