mirror of
https://github.com/BlackMATov/evolved.lua.git
synced 2026-09-27 11:07:08 +07:00
builder:has_all/any
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user