Skip to content

Commit 6d39047

Browse files
committed
added clear Inventory Testing
1 parent 97ac154 commit 6d39047

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

fetch-deps.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ libs=(
1515
"miningClient-lib"
1616
"helperFunctions-lib"
1717
"eventHandler-lib"
18+
"turtleResourceManager-lib"
19+
"config-lib"
1820
)
1921

2022
# Basic setup variables

tests/test_spec.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ local function beforeEach()
122122
package.loaded["miningClient"] = nil
123123
end
124124
-- reset globals
125+
---@type TurtleMock
125126
_G.turtle = turtleEmulator:createTurtle()
126127
local peripheral = turtle.getPeripheralModule()
127128
_G.peripheral = peripheral
@@ -158,6 +159,14 @@ describe("World with ores", function()
158159
beforeEach()
159160
end)
160161
it(" - cleared all Ores", function()
162+
for i = 5, 15, 1 do
163+
turtle.addItemToInventory({name = "minecraft:stone", count = 64, maxcount = 64, placeAble = true})
164+
end
165+
local tmpChest = {name = "enderchests:ender_chest", count = 1, maxcount = 1, placeAble = true}
166+
turtle.addItemToInventory(tmpChest, 16)
167+
local enderCHest = turtleEmulator:addInventoryToItem(tmpChest)
168+
169+
161170
local mappingFunc = function(scanData)
162171
return {
163172
item = {
@@ -182,5 +191,6 @@ describe("World with ores", function()
182191
assert.are.equal(Vector.new(0, 0, 0), turtle.position)
183192
assert.are.equal(Vector.new(1, 0, 0), turtle.facing)
184193
assert.is.not_false(dirt)
194+
assert.is.falsy(turtle.getItemDetail(10))
185195
end)
186196
end)

0 commit comments

Comments
 (0)