• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CyclopsMC / IntegratedDynamics / 20210191346

14 Dec 2025 03:32PM UTC coverage: 19.514% (-33.5%) from 53.061%
20210191346

push

github

rubensworks
Remove deprecations

663 of 8728 branches covered (7.6%)

Branch coverage included in aggregate %.

6786 of 29445 relevant lines covered (23.05%)

1.09 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/org/cyclops/integrateddynamics/gametest/integration/TestBlockOperators.java
1
package org.cyclops.integrateddynamics.gametest.integration;
2

3
import net.minecraft.nbt.CompoundTag;
4
import net.minecraft.nbt.ListTag;
5
import net.minecraft.nbt.StringTag;
6
import net.minecraft.sounds.SoundEvents;
7
import net.minecraft.world.item.ItemStack;
8
import net.minecraft.world.item.Items;
9
import net.minecraft.world.level.block.Blocks;
10
import net.minecraft.world.level.block.CropBlock;
11
import org.cyclops.integrateddynamics.RegistryEntries;
12
import org.cyclops.integrateddynamics.api.evaluate.EvaluationException;
13
import org.cyclops.integrateddynamics.api.evaluate.variable.IValue;
14
import org.cyclops.integrateddynamics.api.evaluate.variable.IVariable;
15
import org.cyclops.integrateddynamics.core.evaluate.operator.Operators;
16
import org.cyclops.integrateddynamics.core.evaluate.variable.*;
17
import org.cyclops.integrateddynamics.core.helper.Helpers;
18
import org.cyclops.integrateddynamics.core.test.IntegrationBefore;
19
import org.cyclops.integrateddynamics.core.test.IntegrationTest;
20
import org.cyclops.integrateddynamics.core.test.TestHelpers;
21

22
/**
23
 * Test the different logical operators.
24
 * @author rubensworks
25
 */
26
public class TestBlockOperators {
×
27

28
    private static final DummyValueType DUMMY_TYPE = DummyValueType.TYPE;
×
29
    private static final DummyVariable<DummyValueType.DummyValue> DUMMY_VARIABLE =
×
30
            new DummyVariable<DummyValueType.DummyValue>(DUMMY_TYPE, DummyValueType.DummyValue.of());
×
31

32
    private DummyVariableBlock bAir;
33
    private DummyVariableBlock bCoal;
34
    private DummyVariableBlock bDarkOakLeaves;
35
    private DummyVariableBlock bLogicProgrammer;
36
    private DummyVariableBlock bLeaves;
37
    private DummyVariableBlock bReed;
38
    private DummyVariableBlock bSand;
39
    private DummyVariableBlock bFarmLand;
40
    private DummyVariableBlock bCarrot;
41
    private DummyVariableBlock bCarrotGrown;
42

43
    private DummyVariableItemStack iApple;
44
    private DummyVariableItemStack iSeedWheat;
45

46
    private DummyVariable<ValueTypeString.ValueString> sSponge;
47
    private DummyVariable<ValueTypeString.ValueString> sSand;
48

49
    private DummyVariable<ValueTypeNbt.ValueNbt> nbtCarrotGrown;
50

51
    @IntegrationBefore
52
    public void before() {
53
        bAir = new DummyVariableBlock(ValueObjectTypeBlock.ValueBlock.of(Blocks.AIR.defaultBlockState()));
×
54
        bCoal = new DummyVariableBlock(ValueObjectTypeBlock.ValueBlock.of(Blocks.COAL_BLOCK.defaultBlockState()));
×
55
        bDarkOakLeaves = new DummyVariableBlock(ValueObjectTypeBlock.ValueBlock.of(Blocks.DARK_OAK_LEAVES.defaultBlockState()));
×
56
        bLogicProgrammer = new DummyVariableBlock(ValueObjectTypeBlock.ValueBlock.of(RegistryEntries.BLOCK_LOGIC_PROGRAMMER.get().defaultBlockState()));
×
57
        bLeaves = new DummyVariableBlock(ValueObjectTypeBlock.ValueBlock.of(Blocks.OAK_LEAVES.defaultBlockState()));
×
58
        bReed = new DummyVariableBlock(ValueObjectTypeBlock.ValueBlock.of(Blocks.SUGAR_CANE.defaultBlockState()));
×
59
        bSand = new DummyVariableBlock(ValueObjectTypeBlock.ValueBlock.of(Blocks.SAND.defaultBlockState()));
×
60
        bFarmLand = new DummyVariableBlock(ValueObjectTypeBlock.ValueBlock.of(Blocks.FARMLAND.defaultBlockState()));
×
61
        bCarrot = new DummyVariableBlock(ValueObjectTypeBlock.ValueBlock.of(Blocks.CARROTS.defaultBlockState()));
×
62
        bCarrotGrown = new DummyVariableBlock(ValueObjectTypeBlock.ValueBlock.of(Blocks.CARROTS.defaultBlockState().setValue(CropBlock.AGE, 1)));
×
63

64
        iApple = new DummyVariableItemStack(ValueObjectTypeItemStack.ValueItemStack.of(new ItemStack(Items.APPLE)));
×
65
        iSeedWheat = new DummyVariableItemStack(ValueObjectTypeItemStack.ValueItemStack.of(new ItemStack(Items.WHEAT_SEEDS)));
×
66

67
        sSponge = new DummyVariable<>(ValueTypes.STRING, ValueTypeString.ValueString.of("minecraft:sponge"));
×
68
        sSand = new DummyVariable<>(ValueTypes.STRING, ValueTypeString.ValueString.of("minecraft:sand"));
×
69

70
        CompoundTag tag = new CompoundTag();
×
71
        tag.putString("age", "1");
×
72
        nbtCarrotGrown = new DummyVariable<>(ValueTypes.NBT, ValueTypeNbt.ValueNbt.of(tag));
×
73
    }
×
74

75
    /**
76
     * ----------------------------------- OPAQUE -----------------------------------
77
     */
78

79
    @IntegrationTest
80
    public void testBlockOpaque() throws EvaluationException {
81
        IValue res1 = Operators.OBJECT_BLOCK_OPAQUE.evaluate(new IVariable[]{bAir});
×
82
        Asserts.check(res1 instanceof ValueTypeBoolean.ValueBoolean, "result is a boolean");
×
83
        TestHelpers.assertEqual(((ValueTypeBoolean.ValueBoolean) res1).getRawValue(), false, "isopaque(air) = false");
×
84

85
        IValue res2 = Operators.OBJECT_BLOCK_OPAQUE.evaluate(new IVariable[]{bCoal});
×
86
        TestHelpers.assertEqual(((ValueTypeBoolean.ValueBoolean) res2).getRawValue(), true, "isopaque(coalblock) = true");
×
87
    }
×
88

89
    @IntegrationTest(expected = EvaluationException.class)
90
    public void testInvalidInputSizeOpaqueLarge() throws EvaluationException {
91
        Operators.OBJECT_BLOCK_OPAQUE.evaluate(new IVariable[]{bAir, bAir});
×
92
    }
×
93

94
    @IntegrationTest(expected = EvaluationException.class)
95
    public void testInvalidInputSizeOpaqueSmall() throws EvaluationException {
96
        Operators.OBJECT_BLOCK_OPAQUE.evaluate(new IVariable[]{});
×
97
    }
×
98

99
    @IntegrationTest(expected = EvaluationException.class)
100
    public void testInvalidInputTypeOpaque() throws EvaluationException {
101
        Operators.OBJECT_BLOCK_OPAQUE.evaluate(new IVariable[]{DUMMY_VARIABLE});
×
102
    }
×
103

104
    /**
105
     * ----------------------------------- ITEMSTACK -----------------------------------
106
     */
107

108
    @IntegrationTest
109
    public void testBlockItemStack() throws EvaluationException {
110
        IValue res1 = Operators.OBJECT_BLOCK_ITEMSTACK.evaluate(new IVariable[]{bAir});
×
111
        Asserts.check(res1 instanceof ValueObjectTypeItemStack.ValueItemStack, "result is an itemstack");
×
112
        TestHelpers.assertEqual(!((ValueObjectTypeItemStack.ValueItemStack) res1).getRawValue().isEmpty(), false, "itemstack(air) = null");
×
113

114
        IValue res2 = Operators.OBJECT_BLOCK_ITEMSTACK.evaluate(new IVariable[]{bCoal});
×
115
        TestHelpers.assertEqual(ItemStack.isSameItem(((ValueObjectTypeItemStack.ValueItemStack) res2).getRawValue(), new ItemStack(Blocks.COAL_BLOCK)), true, "itemstack(coalblock) = coalblock");
×
116

117
        IValue res3 = Operators.OBJECT_BLOCK_ITEMSTACK.evaluate(new IVariable[]{bDarkOakLeaves});
×
118
        TestHelpers.assertEqual(ItemStack.isSameItem(((ValueObjectTypeItemStack.ValueItemStack) res3).getRawValue(), new ItemStack(Blocks.DARK_OAK_LEAVES, 1)), true, "itemstack(dark_oak_leaves) = dark_oak_leaves");
×
119
    }
×
120

121
    @IntegrationTest(expected = EvaluationException.class)
122
    public void testInvalidInputSizeItemStackLarge() throws EvaluationException {
123
        Operators.OBJECT_BLOCK_ITEMSTACK.evaluate(new IVariable[]{bAir, bAir});
×
124
    }
×
125

126
    @IntegrationTest(expected = EvaluationException.class)
127
    public void testInvalidInputSizeItemStackSmall() throws EvaluationException {
128
        Operators.OBJECT_BLOCK_ITEMSTACK.evaluate(new IVariable[]{});
×
129
    }
×
130

131
    @IntegrationTest(expected = EvaluationException.class)
132
    public void testInvalidInputTypeItemStack() throws EvaluationException {
133
        Operators.OBJECT_BLOCK_ITEMSTACK.evaluate(new IVariable[]{DUMMY_VARIABLE});
×
134
    }
×
135

136
    /**
137
     * ----------------------------------- MODNAME -----------------------------------
138
     */
139

140
    @IntegrationTest
141
    public void testBlockModName() throws EvaluationException {
142
        IValue res1 = Operators.OBJECT_BLOCK_MODNAME.evaluate(new IVariable[]{bAir});
×
143
        Asserts.check(res1 instanceof ValueTypeString.ValueString, "result is a string");
×
144
        TestHelpers.assertEqual(((ValueTypeString.ValueString) res1).getRawValue(), "Minecraft", "modname(air) = Minecraft");
×
145

146
        IValue res2 = Operators.OBJECT_BLOCK_MODNAME.evaluate(new IVariable[]{bLogicProgrammer});
×
147
        TestHelpers.assertEqual(((ValueTypeString.ValueString) res2).getRawValue(), "IntegratedDynamics", "modname(logicprogrammer) = IntegratedDynamics");
×
148
    }
×
149

150
    @IntegrationTest(expected = EvaluationException.class)
151
    public void testInvalidInputSizeModNameLarge() throws EvaluationException {
152
        Operators.OBJECT_BLOCK_MODNAME.evaluate(new IVariable[]{bAir, bAir});
×
153
    }
×
154

155
    @IntegrationTest(expected = EvaluationException.class)
156
    public void testInvalidInputSizeModNameSmall() throws EvaluationException {
157
        Operators.OBJECT_BLOCK_MODNAME.evaluate(new IVariable[]{});
×
158
    }
×
159

160
    @IntegrationTest(expected = EvaluationException.class)
161
    public void testInvalidInputTypeModName() throws EvaluationException {
162
        Operators.OBJECT_BLOCK_MODNAME.evaluate(new IVariable[]{DUMMY_VARIABLE});
×
163
    }
×
164

165
    /**
166
     * ----------------------------------- SOUNDS -----------------------------------
167
     */
168

169
    @IntegrationTest
170
    public void testBlockSound() throws EvaluationException {
171
        IValue res1 = Operators.OBJECT_BLOCK_BREAKSOUND.evaluate(new IVariable[]{bCoal});
×
172
        Asserts.check(res1 instanceof ValueTypeString.ValueString, "result is a string");
×
173
        TestHelpers.assertEqual(((ValueTypeString.ValueString) res1).getRawValue(), SoundEvents.STONE_BREAK.location().toString(), "placesound(coal) = inecraft:block.stone.break");
×
174

175
        IValue res2 = Operators.OBJECT_BLOCK_PLACESOUND.evaluate(new IVariable[]{bCoal});
×
176
        Asserts.check(res2 instanceof ValueTypeString.ValueString, "result is a string");
×
177
        TestHelpers.assertEqual(((ValueTypeString.ValueString) res2).getRawValue(), SoundEvents.STONE_PLACE.location().toString(), "placesound(coal) = inecraft:block.stone.place");
×
178

179
        IValue res3 = Operators.OBJECT_BLOCK_STEPSOUND.evaluate(new IVariable[]{bCoal});
×
180
        Asserts.check(res3 instanceof ValueTypeString.ValueString, "result is a string");
×
181
        TestHelpers.assertEqual(((ValueTypeString.ValueString) res3).getRawValue(), SoundEvents.STONE_STEP.location().toString(), "placesound(coal) = inecraft:block.stone.step");
×
182
    }
×
183

184
    @IntegrationTest(expected = EvaluationException.class)
185
    public void testInvalidInputSizeSoundLarge() throws EvaluationException {
186
        Operators.OBJECT_BLOCK_BREAKSOUND.evaluate(new IVariable[]{bAir, bAir});
×
187
        Operators.OBJECT_BLOCK_PLACESOUND.evaluate(new IVariable[]{bAir, bAir});
×
188
        Operators.OBJECT_BLOCK_STEPSOUND.evaluate(new IVariable[]{bAir, bAir});
×
189
    }
×
190

191
    @IntegrationTest(expected = EvaluationException.class)
192
    public void testInvalidInputSizeSoundSmall() throws EvaluationException {
193
        Operators.OBJECT_BLOCK_BREAKSOUND.evaluate(new IVariable[]{});
×
194
        Operators.OBJECT_BLOCK_PLACESOUND.evaluate(new IVariable[]{});
×
195
        Operators.OBJECT_BLOCK_STEPSOUND.evaluate(new IVariable[]{});
×
196
    }
×
197

198
    @IntegrationTest(expected = EvaluationException.class)
199
    public void testInvalidInputTypeSound() throws EvaluationException {
200
        Operators.OBJECT_BLOCK_BREAKSOUND.evaluate(new IVariable[]{DUMMY_VARIABLE});
×
201
        Operators.OBJECT_BLOCK_PLACESOUND.evaluate(new IVariable[]{DUMMY_VARIABLE});
×
202
        Operators.OBJECT_BLOCK_STEPSOUND.evaluate(new IVariable[]{DUMMY_VARIABLE});
×
203
    }
×
204

205
    /**
206
     * ----------------------------------- ISSHEARABLE -----------------------------------
207
     */
208

209
    @IntegrationTest
210
    public void testBlockIsShearable() throws EvaluationException {
211
        IValue res1 = Operators.OBJECT_BLOCK_ISSHEARABLE.evaluate(new IVariable[]{bAir});
×
212
        Asserts.check(res1 instanceof ValueTypeBoolean.ValueBoolean, "result is a boolean");
×
213
        TestHelpers.assertEqual(((ValueTypeBoolean.ValueBoolean) res1).getRawValue(), false, "isshearable(air) = false");
×
214

215
        IValue res2 = Operators.OBJECT_BLOCK_ISSHEARABLE.evaluate(new IVariable[]{bLeaves});
×
216
        TestHelpers.assertEqual(((ValueTypeBoolean.ValueBoolean) res2).getRawValue(), true, "isshearable(leaves) = true");
×
217
    }
×
218

219
    @IntegrationTest(expected = EvaluationException.class)
220
    public void testInvalidInputSizeIsShearableLarge() throws EvaluationException {
221
        Operators.OBJECT_BLOCK_ISSHEARABLE.evaluate(new IVariable[]{bAir, bAir});
×
222
    }
×
223

224
    @IntegrationTest(expected = EvaluationException.class)
225
    public void testInvalidInputSizeIsShearableSmall() throws EvaluationException {
226
        Operators.OBJECT_BLOCK_ISSHEARABLE.evaluate(new IVariable[]{});
×
227
    }
×
228

229
    @IntegrationTest(expected = EvaluationException.class)
230
    public void testInvalidInputTypeIsShearable() throws EvaluationException {
231
        Operators.OBJECT_BLOCK_ISSHEARABLE.evaluate(new IVariable[]{DUMMY_VARIABLE});
×
232
    }
×
233

234
    /**
235
     * ----------------------------------- PLANTAGE -----------------------------------
236
     */
237

238
    @IntegrationTest
239
    public void testBlockPlantAge() throws EvaluationException {
240
        IValue res1 = Operators.OBJECT_BLOCK_PLANTAGE.evaluate(new IVariable[]{bAir});
×
241
        Asserts.check(res1 instanceof ValueTypeInteger.ValueInteger, "result is an integer");
×
242
        TestHelpers.assertEqual(((ValueTypeInteger.ValueInteger) res1).getRawValue(), 0, "plantage(air) = 0");
×
243

244
        IValue res2 = Operators.OBJECT_BLOCK_PLANTAGE.evaluate(new IVariable[]{bCarrot});
×
245
        TestHelpers.assertEqual(((ValueTypeInteger.ValueInteger) res2).getRawValue(), 0, "plantage(bCarrot) = 0");
×
246

247
        IValue res3 = Operators.OBJECT_BLOCK_PLANTAGE.evaluate(new IVariable[]{bCarrotGrown});
×
248
        TestHelpers.assertEqual(((ValueTypeInteger.ValueInteger) res3).getRawValue(), 1, "plantage(bCarrotGrown) = 1");
×
249
    }
×
250

251
    @IntegrationTest(expected = EvaluationException.class)
252
    public void testInvalidInputSizePlantAgeLarge() throws EvaluationException {
253
        Operators.OBJECT_BLOCK_PLANTAGE.evaluate(new IVariable[]{bAir, bAir});
×
254
    }
×
255

256
    @IntegrationTest(expected = EvaluationException.class)
257
    public void testInvalidInputSizePlantAgeSmall() throws EvaluationException {
258
        Operators.OBJECT_BLOCK_PLANTAGE.evaluate(new IVariable[]{});
×
259
    }
×
260

261
    @IntegrationTest(expected = EvaluationException.class)
262
    public void testInvalidInputTypePlantAge() throws EvaluationException {
263
        Operators.OBJECT_BLOCK_PLANTAGE.evaluate(new IVariable[]{DUMMY_VARIABLE});
×
264
    }
×
265

266
    /**
267
     * ----------------------------------- BLOCKBYNAME -----------------------------------
268
     */
269

270
    @IntegrationTest
271
    public void testBlockBlockByName() throws EvaluationException {
272
        IValue res1 = Operators.OBJECT_BLOCK_BY_NAME.evaluate(new IVariable[]{sSponge});
×
273
        Asserts.check(res1 instanceof ValueObjectTypeBlock.ValueBlock, "result is a block");
×
274
        TestHelpers.assertEqual(((ValueObjectTypeBlock.ValueBlock) res1).getRawValue().get(), Blocks.SPONGE.defaultBlockState(), "blockbyname(minecraft:sponge) = sponge");
×
275
    }
×
276

277
    @IntegrationTest(expected = EvaluationException.class)
278
    public void testInvalidInputSizeBlockByNameLarge() throws EvaluationException {
279
        Operators.OBJECT_BLOCK_BY_NAME.evaluate(new IVariable[]{sSponge, sSponge});
×
280
    }
×
281

282
    @IntegrationTest(expected = EvaluationException.class)
283
    public void testInvalidInputSizeBlockByNameSmall() throws EvaluationException {
284
        Operators.OBJECT_BLOCK_BY_NAME.evaluate(new IVariable[]{});
×
285
    }
×
286

287
    @IntegrationTest(expected = EvaluationException.class)
288
    public void testInvalidInputTypeBlockByName() throws EvaluationException {
289
        Operators.OBJECT_BLOCK_BY_NAME.evaluate(new IVariable[]{DUMMY_VARIABLE});
×
290
    }
×
291

292
    /**
293
     * ----------------------------------- BLOCK_PROPERTIES -----------------------------------
294
     */
295

296
    @IntegrationTest
297
    public void testBlockBlockProperties() throws EvaluationException {
298
        IValue res1 = Operators.OBJECT_BLOCK_PROPERTIES.evaluate(new IVariable[]{bCarrotGrown});
×
299
        Asserts.check(res1 instanceof ValueTypeNbt.ValueNbt, "result is an nbt tag");
×
300
        CompoundTag tag = new CompoundTag();
×
301
        tag.putString("age", "1");
×
302
        TestHelpers.assertEqual(((ValueTypeNbt.ValueNbt) res1).getRawValue().get(), tag, "blockproperties(minecraft:carrot) = {...}");
×
303
    }
×
304

305
    @IntegrationTest(expected = EvaluationException.class)
306
    public void testInvalidInputSizeBlockPropertiesLarge() throws EvaluationException {
307
        Operators.OBJECT_BLOCK_PROPERTIES.evaluate(new IVariable[]{bLeaves, bLeaves});
×
308
    }
×
309

310
    @IntegrationTest(expected = EvaluationException.class)
311
    public void testInvalidInputSizeBlockPropertiesSmall() throws EvaluationException {
312
        Operators.OBJECT_BLOCK_PROPERTIES.evaluate(new IVariable[]{});
×
313
    }
×
314

315
    @IntegrationTest(expected = EvaluationException.class)
316
    public void testInvalidInputTypeBlockProperties() throws EvaluationException {
317
        Operators.OBJECT_BLOCK_PROPERTIES.evaluate(new IVariable[]{DUMMY_VARIABLE});
×
318
    }
×
319

320
    /**
321
     * ----------------------------------- BLOCK_WITH_PROPERTIES -----------------------------------
322
     */
323

324
    @IntegrationTest
325
    public void testBlockBlockWithProperties() throws EvaluationException {
326
        IValue res1 = Operators.OBJECT_BLOCK_WITH_PROPERTIES.evaluate(new IVariable[]{bCarrot, nbtCarrotGrown});
×
327
        Asserts.check(res1 instanceof ValueObjectTypeBlock.ValueBlock, "result is a block");
×
328
        TestHelpers.assertEqual(((ValueObjectTypeBlock.ValueBlock) res1).getRawValue().get(), bCarrotGrown.getValue().getRawValue().get(), "blockwithproperties(minecraft:carrot, ...) = {...}");
×
329
    }
×
330

331
    @IntegrationTest(expected = EvaluationException.class)
332
    public void testInvalidInputSizeBlockWithPropertiesLarge() throws EvaluationException {
333
        Operators.OBJECT_BLOCK_WITH_PROPERTIES.evaluate(new IVariable[]{bLeaves, nbtCarrotGrown, bLeaves});
×
334
    }
×
335

336
    @IntegrationTest(expected = EvaluationException.class)
337
    public void testInvalidInputSizeBlockWithPropertiesSmall() throws EvaluationException {
338
        Operators.OBJECT_BLOCK_WITH_PROPERTIES.evaluate(new IVariable[]{bLeaves});
×
339
    }
×
340

341
    @IntegrationTest(expected = EvaluationException.class)
342
    public void testInvalidInputTypeBlockWithProperties() throws EvaluationException {
343
        Operators.OBJECT_BLOCK_WITH_PROPERTIES.evaluate(new IVariable[]{DUMMY_VARIABLE, DUMMY_VARIABLE});
×
344
    }
×
345

346
    /**
347
     * ----------------------------------- BLOCK_POSSIBLE_PROPERTIES -----------------------------------
348
     */
349

350
    @IntegrationTest
351
    public void testBlockBlockPossibleProperties() throws EvaluationException {
352
        IValue res1 = Operators.OBJECT_BLOCK_POSSIBLE_PROPERTIES.evaluate(new IVariable[]{bCarrotGrown});
×
353
        Asserts.check(res1 instanceof ValueTypeNbt.ValueNbt, "result is an nbt tag");
×
354
        CompoundTag tag = new CompoundTag();
×
355
        ListTag list = new ListTag();
×
356
        list.add(StringTag.valueOf("0"));
×
357
        list.add(StringTag.valueOf("1"));
×
358
        list.add(StringTag.valueOf("2"));
×
359
        list.add(StringTag.valueOf("3"));
×
360
        list.add(StringTag.valueOf("4"));
×
361
        list.add(StringTag.valueOf("5"));
×
362
        list.add(StringTag.valueOf("6"));
×
363
        list.add(StringTag.valueOf("7"));
×
364
        tag.put("age", list);
×
365
        TestHelpers.assertEqual(((ValueTypeNbt.ValueNbt) res1).getRawValue().get(), tag, "blockpossibleproperties(minecraft:carrot) = {...}");
×
366
    }
×
367

368
    @IntegrationTest(expected = EvaluationException.class)
369
    public void testInvalidInputSizeBlockPossiblePropertiesLarge() throws EvaluationException {
370
        Operators.OBJECT_BLOCK_POSSIBLE_PROPERTIES.evaluate(new IVariable[]{bLeaves, bLeaves});
×
371
    }
×
372

373
    @IntegrationTest(expected = EvaluationException.class)
374
    public void testInvalidInputSizeBlockPossiblePropertiesSmall() throws EvaluationException {
375
        Operators.OBJECT_BLOCK_POSSIBLE_PROPERTIES.evaluate(new IVariable[]{});
×
376
    }
×
377

378
    @IntegrationTest(expected = EvaluationException.class)
379
    public void testInvalidInputTypeBlockPossibleProperties() throws EvaluationException {
380
        Operators.OBJECT_BLOCK_POSSIBLE_PROPERTIES.evaluate(new IVariable[]{DUMMY_VARIABLE});
×
381
    }
×
382

383
    /**
384
     * ----------------------------------- TAG -----------------------------------
385
     */
386

387
    @IntegrationTest
388
    public void testBlockTag() throws EvaluationException {
389
        IValue res1 = Operators.OBJECT_BLOCK_TAG.evaluate(new IVariable[]{bSand});
×
390
        Asserts.check(res1 instanceof ValueTypeList.ValueList, "result is a list");
×
391
        TestHelpers.assertEqual(((ValueTypeList.ValueList) res1).getRawValue().getLength(), 19, "size(tag(sand)) = 19");
×
392

393
        IValue res2 = Operators.OBJECT_BLOCK_TAG.evaluate(new IVariable[]{bLeaves});
×
394
        TestHelpers.assertEqual(((ValueTypeList.ValueList) res2).getRawValue().getLength(), 8, "size(tag(leaves)) = 8");
×
395
    }
×
396

397
    @IntegrationTest(expected = EvaluationException.class)
398
    public void testInvalidInputSizeTagLarge() throws EvaluationException {
399
        Operators.OBJECT_BLOCK_TAG.evaluate(new IVariable[]{bLeaves, bLeaves});
×
400
    }
×
401

402
    @IntegrationTest(expected = EvaluationException.class)
403
    public void testInvalidInputSizeTagSmall() throws EvaluationException {
404
        Operators.OBJECT_BLOCK_TAG.evaluate(new IVariable[]{});
×
405
    }
×
406

407
    @IntegrationTest(expected = EvaluationException.class)
408
    public void testInvalidInputTypeTag() throws EvaluationException {
409
        Operators.OBJECT_BLOCK_TAG.evaluate(new IVariable[]{DUMMY_VARIABLE});
×
410
    }
×
411

412
    /**
413
     * ----------------------------------- TAG_STACKS -----------------------------------
414
     */
415

416
    @IntegrationTest
417
    public void testBlockTagStacks() throws EvaluationException {
418
        IValue res1 = Operators.OBJECT_BLOCK_TAG_STACKS.evaluate(new IVariable[]{sSand});
×
419
        Asserts.check(res1 instanceof ValueTypeList.ValueList, "result is a list");
×
420
        TestHelpers.assertEqual(((ValueTypeList.ValueList) res1).getRawValue().getLength(), (int) Helpers.getBlockTagValues("minecraft:sand").count(), "size(tag_stacks(sand))");
×
421
    }
×
422

423
    @IntegrationTest(expected = EvaluationException.class)
424
    public void testInvalidInputSizeTagStacksLarge() throws EvaluationException {
425
        Operators.OBJECT_BLOCK_TAG_STACKS.evaluate(new IVariable[]{sSand, sSand});
×
426
    }
×
427

428
    @IntegrationTest(expected = EvaluationException.class)
429
    public void testInvalidInputSizeTagStacksSmall() throws EvaluationException {
430
        Operators.OBJECT_BLOCK_TAG_STACKS.evaluate(new IVariable[]{});
×
431
    }
×
432

433
    @IntegrationTest(expected = EvaluationException.class)
434
    public void testInvalidInputTypeTagStacks() throws EvaluationException {
435
        Operators.OBJECT_BLOCK_TAG_STACKS.evaluate(new IVariable[]{DUMMY_VARIABLE});
×
436
    }
×
437

438
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc