Skip to content

Commit

Permalink
Adapted some me bridge tests to the new me bridge peripheral
Browse files Browse the repository at this point in the history
  • Loading branch information
SirEndii committed Sep 7, 2024
1 parent 42306b6 commit 2b9d612
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test.eq(1, noteBlock.getNote(), "Note should be 1")
noteBlock.playNote()

-- this note block has a block above it, so it should not play a note
test.eq("noteBlock", peripheral.getType("right"), "Peripheral should be noteBlock")
test.eq("note_block", peripheral.getType("right"), "Peripheral should be noteBlock")
silentNoteBlock = peripheral.wrap("right")
test.assert(silentNoteBlock, "Peripheral not found")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,33 +41,34 @@ test.assert(availableFluidStorage == 64511, "Available fluid storage is not vali

cells = bridge.listCells()
test.assert(#cells == 2, "There should be 2 cells")

print(textutils.serialize(cells[1]))
itemCell = nil
fluidCell = nil
for _, cell in pairs(cells) do
if cell.cellType == "item" then
if cell.type == "ae2:i" then
itemCell = cell
end
end
for _, cell in pairs(cells) do
if cell.cellType == "fluid" then
if cell.type == "ae2:f" then
fluidCell = cell
end
end

test.assert(itemCell, "Item cell not found")
test.assert(fluidCell, "Fluid cell not found")

itemCellBytes = itemCell.totalBytes
itemCellBytes = itemCell.bytes
print(textutils.serialize(itemCell))
test.assert(itemCellBytes == 65536, "Item cell bytes is not valid")

fluidCellBytes = fluidCell.totalBytes
fluidCellBytes = fluidCell.bytes
test.assert(fluidCellBytes == 65536, "Fluid cell bytes is not valid")

itemCellItem = itemCell.item
itemCellItem = itemCell.item.name
test.assert(itemCellItem == "ae2:item_storage_cell_64k", "Item cell item not found")

fluidCellItem = fluidCell.item
fluidCellItem = fluidCell.item.name
test.assert(fluidCellItem == "ae2:fluid_storage_cell_64k", "Fluid cell item not found")

itemCellBytesPerType = itemCell.bytesPerType
Expand Down

0 comments on commit 2b9d612

Please sign in to comment.