|
117 | 117 | assert(evo.get(e, f1) == nil) |
118 | 118 | assert(evo.get(e, f2) == nil) |
119 | 119 |
|
120 | | - local c1, c2 = evo.get(e, f1, f2) |
| 120 | + local c1, c2 = evo.get_all(e, f1, f2) |
121 | 121 | assert(c1 == nil and c2 == nil) |
122 | 122 | end |
123 | 123 |
|
|
134 | 134 | assert(evo.get(e, f1) == 41) |
135 | 135 | assert(evo.get(e, f2) == nil) |
136 | 136 |
|
137 | | - local c1, c2 = evo.get(e, f1, f2) |
| 137 | + local c1, c2 = evo.get_all(e, f1, f2) |
138 | 138 | assert(c1 == 41 and c2 == nil) |
139 | 139 | end |
140 | 140 |
|
|
151 | 151 | assert(evo.get(e, f1) == 41) |
152 | 152 | assert(evo.get(e, f2) == 42) |
153 | 153 |
|
154 | | - local c1, c2 = evo.get(e, f1, f2) |
| 154 | + local c1, c2 = evo.get_all(e, f1, f2) |
155 | 155 | assert(c1 == 41 and c2 == 42) |
156 | 156 | end |
157 | 157 | end |
|
166 | 166 |
|
167 | 167 | do |
168 | 168 | assert(evo.has_all(e, f1, f2)) |
169 | | - local c1, c2 = evo.get(e, f1, f2) |
| 169 | + local c1, c2 = evo.get_all(e, f1, f2) |
170 | 170 | assert(c1 == 41 and c2 == 42) |
171 | 171 | end |
172 | 172 | end |
|
184 | 184 | assert(not evo.has(e, f1)) |
185 | 185 | assert(evo.has(e, f2)) |
186 | 186 |
|
187 | | - local c1, c2 = evo.get(e, f1, f2) |
| 187 | + local c1, c2 = evo.get_all(e, f1, f2) |
188 | 188 | assert(c1 == nil and c2 == 42) |
189 | 189 | end |
190 | 190 |
|
|
198 | 198 | assert(evo.has(e, f1)) |
199 | 199 | assert(not evo.has(e, f2)) |
200 | 200 |
|
201 | | - local c1, c2 = evo.get(e, f1, f2) |
| 201 | + local c1, c2 = evo.get_all(e, f1, f2) |
202 | 202 | assert(c1 == 41 and c2 == nil) |
203 | 203 | end |
204 | 204 |
|
|
211 | 211 |
|
212 | 212 | assert(not evo.has_any(e, f1, f2)) |
213 | 213 |
|
214 | | - local c1, c2 = evo.get(e, f1, f2) |
| 214 | + local c1, c2 = evo.get_all(e, f1, f2) |
215 | 215 | assert(c1 == nil and c2 == nil) |
216 | 216 | end |
217 | 217 | end |
@@ -3066,55 +3066,55 @@ do |
3066 | 3066 | do |
3067 | 3067 | local q = qb:build() |
3068 | 3068 |
|
3069 | | - local includes, excludes = evo.get(q, evo.INCLUDES, evo.EXCLUDES) |
| 3069 | + local includes, excludes = evo.get_all(q, evo.INCLUDES, evo.EXCLUDES) |
3070 | 3070 | assert(includes == nil) |
3071 | 3071 | assert(excludes == nil) |
3072 | 3072 | end |
3073 | 3073 |
|
3074 | 3074 | do |
3075 | 3075 | local q = qb:include(f1):build() |
3076 | 3076 |
|
3077 | | - local includes, excludes = evo.get(q, evo.INCLUDES, evo.EXCLUDES) |
| 3077 | + local includes, excludes = evo.get_all(q, evo.INCLUDES, evo.EXCLUDES) |
3078 | 3078 | assert(#includes == 1 and includes[1] == f1) |
3079 | 3079 | assert(excludes == nil) |
3080 | 3080 | end |
3081 | 3081 |
|
3082 | 3082 | do |
3083 | 3083 | local q = qb:include(f1, f2):build() |
3084 | 3084 |
|
3085 | | - local includes, excludes = evo.get(q, evo.INCLUDES, evo.EXCLUDES) |
| 3085 | + local includes, excludes = evo.get_all(q, evo.INCLUDES, evo.EXCLUDES) |
3086 | 3086 | assert(#includes == 2 and includes[1] == f1 and includes[2] == f2) |
3087 | 3087 | assert(excludes == nil) |
3088 | 3088 | end |
3089 | 3089 |
|
3090 | 3090 | do |
3091 | 3091 | local q = qb:include(f1):include(f2):build() |
3092 | 3092 |
|
3093 | | - local includes, excludes = evo.get(q, evo.INCLUDES, evo.EXCLUDES) |
| 3093 | + local includes, excludes = evo.get_all(q, evo.INCLUDES, evo.EXCLUDES) |
3094 | 3094 | assert(#includes == 2 and includes[1] == f1 and includes[2] == f2) |
3095 | 3095 | assert(excludes == nil) |
3096 | 3096 | end |
3097 | 3097 |
|
3098 | 3098 | do |
3099 | 3099 | local q = qb:exclude(f1):build() |
3100 | 3100 |
|
3101 | | - local includes, excludes = evo.get(q, evo.INCLUDES, evo.EXCLUDES) |
| 3101 | + local includes, excludes = evo.get_all(q, evo.INCLUDES, evo.EXCLUDES) |
3102 | 3102 | assert(includes == nil) |
3103 | 3103 | assert(#excludes == 1 and excludes[1] == f1) |
3104 | 3104 | end |
3105 | 3105 |
|
3106 | 3106 | do |
3107 | 3107 | local q = qb:exclude(f1, f2):build() |
3108 | 3108 |
|
3109 | | - local includes, excludes = evo.get(q, evo.INCLUDES, evo.EXCLUDES) |
| 3109 | + local includes, excludes = evo.get_all(q, evo.INCLUDES, evo.EXCLUDES) |
3110 | 3110 | assert(includes == nil) |
3111 | 3111 | assert(#excludes == 2 and excludes[1] == f1 and excludes[2] == f2) |
3112 | 3112 | end |
3113 | 3113 |
|
3114 | 3114 | do |
3115 | 3115 | local q = qb:exclude(f1):exclude(f2):build() |
3116 | 3116 |
|
3117 | | - local includes, excludes = evo.get(q, evo.INCLUDES, evo.EXCLUDES) |
| 3117 | + local includes, excludes = evo.get_all(q, evo.INCLUDES, evo.EXCLUDES) |
3118 | 3118 | assert(includes == nil) |
3119 | 3119 | assert(#excludes == 2 and excludes[1] == f1 and excludes[2] == f2) |
3120 | 3120 | end |
|
3125 | 3125 |
|
3126 | 3126 | local q = qb:build() |
3127 | 3127 |
|
3128 | | - local includes, excludes = evo.get(q, evo.INCLUDES, evo.EXCLUDES) |
| 3128 | + local includes, excludes = evo.get_all(q, evo.INCLUDES, evo.EXCLUDES) |
3129 | 3129 | assert(#includes == 1 and includes[1] == f1) |
3130 | 3130 | assert(#excludes == 1 and excludes[1] == f2) |
3131 | 3131 | end |
@@ -4730,31 +4730,31 @@ do |
4730 | 4730 | assert(c1 == 11) |
4731 | 4731 | end |
4732 | 4732 | do |
4733 | | - local c1, c2 = evo.get(e, f1, f2) |
| 4733 | + local c1, c2 = evo.get_all(e, f1, f2) |
4734 | 4734 | assert(c1 == 11 and c2 == 22) |
4735 | 4735 | end |
4736 | 4736 | do |
4737 | | - local c2, c1 = evo.get(e, f2, f1) |
| 4737 | + local c2, c1 = evo.get_all(e, f2, f1) |
4738 | 4738 | assert(c1 == 11 and c2 == 22) |
4739 | 4739 | end |
4740 | 4740 | do |
4741 | | - local c1, c2, c3 = evo.get(e, f1, f2, f3) |
| 4741 | + local c1, c2, c3 = evo.get_all(e, f1, f2, f3) |
4742 | 4742 | assert(c1 == 11 and c2 == 22 and c3 == 33) |
4743 | 4743 | end |
4744 | 4744 | do |
4745 | | - local c3, c2, c1 = evo.get(e, f3, f2, f1) |
| 4745 | + local c3, c2, c1 = evo.get_all(e, f3, f2, f1) |
4746 | 4746 | assert(c1 == 11 and c2 == 22 and c3 == 33) |
4747 | 4747 | end |
4748 | 4748 | do |
4749 | | - local c1, c2, c3, c4 = evo.get(e, f1, f2, f3, f4) |
| 4749 | + local c1, c2, c3, c4 = evo.get_all(e, f1, f2, f3, f4) |
4750 | 4750 | assert(c1 == 11 and c2 == 22 and c3 == 33 and c4 == 44) |
4751 | 4751 | end |
4752 | 4752 | do |
4753 | | - local c1, c2, c3, c4, c5 = evo.get(e, f1, f2, f3, f4, f5) |
| 4753 | + local c1, c2, c3, c4, c5 = evo.get_all(e, f1, f2, f3, f4, f5) |
4754 | 4754 | assert(c1 == 11 and c2 == 22 and c3 == 33 and c4 == 44 and c5 == 55) |
4755 | 4755 | end |
4756 | 4756 | do |
4757 | | - local c5, c4, c3, c2, c1 = evo.get(e, f5, f4, f3, f2, f1) |
| 4757 | + local c5, c4, c3, c2, c1 = evo.get_all(e, f5, f4, f3, f2, f1) |
4758 | 4758 | assert(c1 == 11 and c2 == 22 and c3 == 33 and c4 == 44 and c5 == 55) |
4759 | 4759 | end |
4760 | 4760 | end |
@@ -8699,3 +8699,73 @@ do |
8699 | 8699 | end |
8700 | 8700 | end |
8701 | 8701 | end |
| 8702 | + |
| 8703 | +do |
| 8704 | + local f1, f2, f3, f4, f5 = evo.id(5) |
| 8705 | + |
| 8706 | + do |
| 8707 | + local b = evo.builder() |
| 8708 | + |
| 8709 | + do |
| 8710 | + assert(b:get_all() == nil) |
| 8711 | + end |
| 8712 | + |
| 8713 | + do |
| 8714 | + local c1 = b:get_all(f1) |
| 8715 | + assert(c1 == nil) |
| 8716 | + end |
| 8717 | + |
| 8718 | + do |
| 8719 | + local c1, c2 = b:get_all(f1, f2) |
| 8720 | + assert(c1 == nil and c2 == nil) |
| 8721 | + end |
| 8722 | + |
| 8723 | + do |
| 8724 | + local c1, c2, c3 = b:get_all(f1, f2, f3) |
| 8725 | + assert(c1 == nil and c2 == nil and c3 == nil) |
| 8726 | + end |
| 8727 | + |
| 8728 | + do |
| 8729 | + local c1, c2, c3, c4 = b:get_all(f1, f2, f3, f4) |
| 8730 | + assert(c1 == nil and c2 == nil and c3 == nil and c4 == nil) |
| 8731 | + end |
| 8732 | + |
| 8733 | + do |
| 8734 | + local c1, c2, c3, c4, c5 = b:get_all(f1, f2, f3, f4, f5) |
| 8735 | + assert(c1 == nil and c2 == nil and c3 == nil and c4 == nil and c5 == nil) |
| 8736 | + end |
| 8737 | + end |
| 8738 | + |
| 8739 | + do |
| 8740 | + local b = evo.builder():set(f1, 11):set(f2, 22):set(f3, 33):set(f4, 44):set(f5, 55) |
| 8741 | + |
| 8742 | + do |
| 8743 | + assert(b:get_all() == nil) |
| 8744 | + end |
| 8745 | + |
| 8746 | + do |
| 8747 | + local c1 = b:get_all(f1) |
| 8748 | + assert(c1 == 11) |
| 8749 | + end |
| 8750 | + |
| 8751 | + do |
| 8752 | + local c1, c2 = b:get_all(f1, f2) |
| 8753 | + assert(c1 == 11 and c2 == 22) |
| 8754 | + end |
| 8755 | + |
| 8756 | + do |
| 8757 | + local c1, c2, c3 = b:get_all(f1, f2, f3) |
| 8758 | + assert(c1 == 11 and c2 == 22 and c3 == 33) |
| 8759 | + end |
| 8760 | + |
| 8761 | + do |
| 8762 | + local c1, c2, c3, c4 = b:get_all(f1, f2, f3, f4) |
| 8763 | + assert(c1 == 11 and c2 == 22 and c3 == 33 and c4 == 44) |
| 8764 | + end |
| 8765 | + |
| 8766 | + do |
| 8767 | + local c1, c2, c3, c4, c5 = b:get_all(f1, f2, f3, f4, f5) |
| 8768 | + assert(c1 == 11 and c2 == 22 and c3 == 33 and c4 == 44 and c5 == 55) |
| 8769 | + end |
| 8770 | + end |
| 8771 | +end |
0 commit comments