local N=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 f=N.test local u=N.expect local p=require("\046\046\047\105\110\105\116")local b=p.Future f("\109\097\112\079\107",function()local N=b.new(function()return"\097","\098","\099"end)N:mapOk(function(N,f,u)return N=="\097"and 1,f=="\098"and 2,u=="\099"and 3 end)local f=N:await();(u(f:isOk())).toBe(true)local p={f:unwrapOk()};(u(p)).toEqual({1,2,3})end)
local JestGlobals = require("@DevPackages/JestGlobals")

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

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

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

	myFuture:mapOk(function(a, b, c)
		return a == "a" and 1, b == "b" and 2, c == "c" and 3
	end)

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

	local values = { result:unwrapOk() }

	expect(values).toEqual({ 1, 2, 3 })
end)
