local s=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local u=require(s.Packages.iter)return function()describe("\116\097\107\101",function()it("\115\104\111\117\108\100 \116\097\107\101 \117\112 \116\111 \096\110\096 \101\108\101\109\101\110\116\115",function()local s={1,2,3,4;5;6}local c=((u.new(s)):take(3)):collect();(expect(#c)).to.be.equal(3);(expect(c[1])).to.be.equal(1);(expect(c[2])).to.be.equal(2);(expect(c[3])).to.be.equal(3)end)it("\115\104\111\117\108\100 \116\097\107\101 \097\108\108 \101\108\101\109\101\110\116\115 \105\102 \116\111\116\097\108 \110\117\109 \060 \096\110\096",function()local s={1;2,3}local c=((u.new(s)):take(6)):collect();(expect(#c)).to.be.equal(3);(expect(c[1])).to.be.equal(1);(expect(c[2])).to.be.equal(2);(expect(c[3])).to.be.equal(3)end)end)end
--!strict
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local iter = require(ReplicatedStorage.Packages.iter)

return function()
	describe("take", function()
		it("should take up to `n` elements", function()
			local a = { 1, 2, 3, 4, 5, 6 }

			local result = iter.new(a):take(3):collect()

			expect(#result).to.be.equal(3)
			expect(result[1]).to.be.equal(1)
			expect(result[2]).to.be.equal(2)
			expect(result[3]).to.be.equal(3)
		end)

		it("should take all elements if total num < `n`", function()
			local a = { 1, 2, 3 }

			local result = iter.new(a):take(6):collect()

			expect(#result).to.be.equal(3)
			expect(result[1]).to.be.equal(1)
			expect(result[2]).to.be.equal(2)
			expect(result[3]).to.be.equal(3)
		end)
	end)
end
