builder:has_all/any

This commit is contained in:
BlackMATov
2025-04-18 15:12:11 +07:00
parent 63172bb84d
commit 1294aa98b8
3 changed files with 100 additions and 0 deletions
+18
View File
@@ -8622,9 +8622,15 @@ do
do
local b = evo.builder()
assert(b:has_all())
assert(not b:has_any())
assert(not b:has(f1) and b:get(f1) == nil)
assert(not b:has(f2) and b:get(f2) == nil)
assert(not b:has_all(f1, f2))
assert(not b:has_any(f1, f2))
do
local e = b:build(true)
@@ -8637,6 +8643,9 @@ do
assert(b:has(f1) and b:get(f1) == 41)
assert(not b:has(f2) and b:get(f2) == nil)
assert(not b:has_all(f1, f2))
assert(b:has_any(f1, f2))
do
local e = b:build(true)
@@ -8649,6 +8658,9 @@ do
assert(b:has(f1) and b:get(f1) == 41)
assert(b:has(f2) and b:get(f2) == 42)
assert(b:has_all(f1, f2))
assert(b:has_any(f1, f2))
do
local e = b:build(true)
@@ -8661,6 +8673,9 @@ do
assert(not b:has(f1) and b:get(f1) == nil)
assert(b:has(f2) and b:get(f2) == 42)
assert(not b:has_all(f1, f2))
assert(b:has_any(f1, f2))
do
local e = b:build(true)
@@ -8670,6 +8685,9 @@ do
b:remove(f2)
assert(not b:has_all(f1, f2))
assert(not b:has_any(f1, f2))
assert(not b:has(f1) and b:get(f1) == nil)
assert(not b:has(f2) and b:get(f2) == nil)