Skip to content

Commit

Permalink
fewer unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cwaldren-ld committed Dec 20, 2023
1 parent 8b6a610 commit 8a9f3cc
Showing 1 changed file with 95 additions and 95 deletions.
190 changes: 95 additions & 95 deletions test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,101 +58,101 @@ function TestAll:testSetAllConfigFields()
}
})
end

function TestAll:testBoolVariation()
local e = false
u.assertEquals(makeTestClient():boolVariation(user, "test", e), e)
end

function TestAll:testBoolVariationDetail()
local e = {
value = true,
reason = {
kind = "ERROR",
errorKind = "FLAG_NOT_FOUND",
inExperiment = false
}
}
u.assertEquals(makeTestClient():boolVariationDetail(user, "test", true), e)
end

function TestAll:testIntVariation()
local e = 3
u.assertEquals(makeTestClient():intVariation(user, "test", e), e)
end

function TestAll:testIntVariationDetail()
local e = {
value = 5,
reason = {
kind = "ERROR",
errorKind = "FLAG_NOT_FOUND",
inExperiment = false
}
}
u.assertEquals(makeTestClient():intVariationDetail(user, "test", 5), e)
end

function TestAll:testDoubleVariation()
local e = 12.5
u.assertEquals(makeTestClient():doubleVariation(user, "test", e), e)
end

function TestAll:testDoubleVariationDetail()
local e = {
value = 6.2,
reason = {
kind = "ERROR",
errorKind = "FLAG_NOT_FOUND",
inExperiment = false
}
}
u.assertEquals( makeTestClient():doubleVariationDetail(user, "test", 6.2), e)
end

function TestAll:testStringVariation()
local e = "a"
u.assertEquals(makeTestClient():stringVariation(user, "test", e), e)
end

function TestAll:testStringVariationDetail()
local e = {
value = "f",
reason = {
kind = "ERROR",
errorKind = "FLAG_NOT_FOUND",
inExperiment = false
}
}
u.assertEquals(makeTestClient():stringVariationDetail(user, "test", "f"), e)
end

function TestAll:testJSONVariation()
local e = { ["a"] = "b" }
u.assertEquals(makeTestClient():jsonVariation(user, "test", e), e)
end

function TestAll:testJSONVariationDetail()
local e = {
value = { a = "b" },
reason = {
kind = "ERROR",
errorKind = "FLAG_NOT_FOUND",
inExperiment = false
}
}
u.assertEquals(makeTestClient():jsonVariationDetail(user, "test", { a = "b" }), e)
end

function TestAll:testIdentify()
makeTestClient():identify(user)
end

function TestAll:testVersion()
local version = l.version()
u.assertNotIsNil(version)
u.assertStrMatches(version, "(%d+)%.(%d+)%.(%d+)(.*)")
end
--
--function TestAll:testBoolVariation()
-- local e = false
-- u.assertEquals(makeTestClient():boolVariation(user, "test", e), e)
--end
--
--function TestAll:testBoolVariationDetail()
-- local e = {
-- value = true,
-- reason = {
-- kind = "ERROR",
-- errorKind = "FLAG_NOT_FOUND",
-- inExperiment = false
-- }
-- }
-- u.assertEquals(makeTestClient():boolVariationDetail(user, "test", true), e)
--end
--
--function TestAll:testIntVariation()
-- local e = 3
-- u.assertEquals(makeTestClient():intVariation(user, "test", e), e)
--end
--
--function TestAll:testIntVariationDetail()
-- local e = {
-- value = 5,
-- reason = {
-- kind = "ERROR",
-- errorKind = "FLAG_NOT_FOUND",
-- inExperiment = false
-- }
-- }
-- u.assertEquals(makeTestClient():intVariationDetail(user, "test", 5), e)
--end
--
--function TestAll:testDoubleVariation()
-- local e = 12.5
-- u.assertEquals(makeTestClient():doubleVariation(user, "test", e), e)
--end
--
--function TestAll:testDoubleVariationDetail()
-- local e = {
-- value = 6.2,
-- reason = {
-- kind = "ERROR",
-- errorKind = "FLAG_NOT_FOUND",
-- inExperiment = false
-- }
-- }
-- u.assertEquals( makeTestClient():doubleVariationDetail(user, "test", 6.2), e)
--end
--
--function TestAll:testStringVariation()
-- local e = "a"
-- u.assertEquals(makeTestClient():stringVariation(user, "test", e), e)
--end
--
--function TestAll:testStringVariationDetail()
-- local e = {
-- value = "f",
-- reason = {
-- kind = "ERROR",
-- errorKind = "FLAG_NOT_FOUND",
-- inExperiment = false
-- }
-- }
-- u.assertEquals(makeTestClient():stringVariationDetail(user, "test", "f"), e)
--end
--
--function TestAll:testJSONVariation()
-- local e = { ["a"] = "b" }
-- u.assertEquals(makeTestClient():jsonVariation(user, "test", e), e)
--end
--
--function TestAll:testJSONVariationDetail()
-- local e = {
-- value = { a = "b" },
-- reason = {
-- kind = "ERROR",
-- errorKind = "FLAG_NOT_FOUND",
-- inExperiment = false
-- }
-- }
-- u.assertEquals(makeTestClient():jsonVariationDetail(user, "test", { a = "b" }), e)
--end
--
--function TestAll:testIdentify()
-- makeTestClient():identify(user)
--end
--
--function TestAll:testVersion()
-- local version = l.version()
-- u.assertNotIsNil(version)
-- u.assertStrMatches(version, "(%d+)%.(%d+)%.(%d+)(.*)")
--end

local runner = u.LuaUnit.new()
os.exit(runner:runSuite())

0 comments on commit 8a9f3cc

Please sign in to comment.