1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-12 08:42:29 +08:00

feat: add Ternary

This commit is contained in:
dudaodong
2024-11-08 14:20:35 +08:00
parent 08f14d2b08
commit de877e5278
5 changed files with 90 additions and 10 deletions

View File

@@ -124,13 +124,13 @@ func TestNand(t *testing.T) {
assert.Equal(false, Nand(1, 1))
}
func TestTernaryOperator(t *testing.T) {
func TestTernary(t *testing.T) {
t.Parallel()
assert := internal.NewAssert(t, "TernaryOperator")
assert := internal.NewAssert(t, "TestTernary")
trueValue := "1"
falseValue := "0"
assert.Equal(trueValue, TernaryOperator(true, trueValue, falseValue))
assert.Equal(trueValue, Ternary(true, trueValue, falseValue))
}