Skip to content

Commit

Permalink
✅ Add tests for the dump module
Browse files Browse the repository at this point in the history
  • Loading branch information
aksiome committed Mar 22, 2024
1 parent 829234a commit 4a63976
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions datapacks/Bookshelf Dev/data/bs.dump/tests/var.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Dumping var works as expected
# @batch bs.dump
# @dummy

data modify storage bs:data packtest set value {foo:"bar"}
function #bs.dump:var { var: { storage: "storage bs:data packtest", entity:"entity @s {} 0", score: ["3 bs.const", "-_- bs.const"] }}

assert chat '.*?\\{[\\s\\S]*storage: \\{[\\s\\S]*foo: \\"bar\\"[\\s\\S]*\\}[\\s\\S]*\\}'
assert chat '.*?\\{[\\s\\S]*entity: \\{ [0-9]+ entries .*? \\}[\\s\\S]*\\}'
assert chat '.*?\\{[\\s\\S]*score: \\[3, undefined\\][\\s\\S]*\\}'

data remove storage bs:data packtest

0 comments on commit 4a63976

Please sign in to comment.