local W=require("\064\068\101\118\080\097\099\107\097\103\101\115\047\074\101\115\116\071\108\111\098\097\108\115")local z=W.test local g=W.expect local Q=require("\046\046\047\105\110\105\116")local s=Q.Future z("\106\111\105\110\065\108\108",function()local W=s.new(function()return"\097","\098","\099"end)local z=W:joinAll(s.new(function()return"\100","\101","\102"end),s.new(function()return"\103","\104","\105"end),s.new(function()return"\106","\107","\108"end))local Q=z:await();(g(Q:isOk())).toBe(true)local t={Q:unwrapOk()};(g(t)).toEqual({"\097";"\098";"\099","\100";"\101","\102";"\103";"\104","\105","\106";"\107";"\108"})end)
local JestGlobals = require("@DevPackages/JestGlobals")

local test = JestGlobals.test
local expect = JestGlobals.expect

local Futures = require("../init")
local Future = Futures.Future

test("joinAll", function()
	local myFuture = Future.new(function()
		return "a", "b", "c"
	end)

	local nextFuture = myFuture:joinAll(
		Future.new(function()
			return "d", "e", "f"
		end),
		Future.new(function()
			return "g", "h", "i"
		end),
		Future.new(function()
			return "j", "k", "l"
		end)
	)

	local result = nextFuture:await()
	expect(result:isOk()).toBe(true)

	local values = { result:unwrapOk() }

    -- stylua: ignore
	expect(values).toEqual({
        "a", "b", "c",
        "d", "e", "f",
        "g", "h", "i",
        "j", "k", "l",
    })
end)
