Skip to content

Commit

Permalink
tried parsing section
Browse files Browse the repository at this point in the history
  • Loading branch information
Efnilite committed Jun 15, 2024
1 parent 5882f93 commit 8772dd5
Showing 1 changed file with 73 additions and 70 deletions.
143 changes: 73 additions & 70 deletions src/test/skript/junit/EvtPiglinBarter.sk
Original file line number Diff line number Diff line change
@@ -1,85 +1,88 @@
test "EvtPiglinBarterJUnit" when running JUnit:

set {_test} to "org.skriptlang.skript.test.tests.syntaxes.events.EvtPiglinBarterTest"
send "test called" to console

if running below minecraft "1.16.5":
complete objective "correct barter input" for {_test}
complete objective "clear barter drops" for {_test}
complete objective "set barter drops to 2 items" for {_test}
complete objective "remove item from barter drops" for {_test}
complete objective "add multiple items to barter drops" for {_test}
complete objective "remove all of an item from barter drops" for {_test}
complete objective "remove multiple items from barter drops" for {_test}
complete objective "barter drops test complete" for {_test}

set {_tests::1} to "correct barter input"
set {_tests::2} to "clear barter drops"
set {_tests::3} to "set barter drops to 2 items"
set {_tests::4} to "remove item from barter drops"
set {_tests::5} to "add multiple items to barter drops"
set {_tests::6} to "remove all of an item from barter drops"
set {_tests::7} to "remove multiple items from barter drops"
set {_tests::8} to "barter drops test complete"
ensure {_test} completes {_tests::*}
send "old" to console
set {_tests::1} to "unsupported version"
if {EvtPiglinBarter::parse::*} contains "Can't understand this structure: on piglin barter":
complete objective {_tests::1} for {_test}
ensure {_test} completes {_tests::*}
else:
send "setting tests" to console
set {_tests::1} to "correct barter input"
set {_tests::2} to "clear barter drops"
set {_tests::3} to "set barter drops to 2 items"
set {_tests::4} to "remove item from barter drops"
set {_tests::5} to "add multiple items to barter drops"
set {_tests::6} to "remove all of an item from barter drops"
set {_tests::7} to "remove multiple items from barter drops"
set {_tests::8} to "barter drops test complete"
send {EvtPiglinBarter::parse::*} to console
ensure {_test} completes {_tests::*}

on piglin barter:
set {_test} to "org.skriptlang.skript.test.tests.syntaxes.events.EvtPiglinBarterTest"
junit test is {_test}
parse:
results: {EvtPiglinBarter::parse::*}
code:
on piglin barter:
send "running barter"
set {_test} to "org.skriptlang.skript.test.tests.syntaxes.events.EvtPiglinBarterTest"
junit test is {_test}

# Items
# Items

if barter input is gold ingot:
complete objective "correct barter input" for {_test}
if barter input is gold ingot:
complete objective "correct barter input" for {_test}

clear barter drops
if size of barter drops is 0:
complete objective "clear barter drops" for {_test}
clear barter drops
if size of barter drops is 0:
complete objective "clear barter drops" for {_test}

set barter drops to 1 emerald and 1 diamond
if:
size of barter drops is 2
barter drops contains 1 emerald
barter drops contains 1 diamond
then:
complete objective "set barter drops to 2 items" for {_test}
set barter drops to 1 emerald and 1 diamond
if:
size of barter drops is 2
barter drops contains 1 emerald
barter drops contains 1 diamond
then:
complete objective "set barter drops to 2 items" for {_test}

add 1 iron ingot to barter drops
if:
size of barter drops is 3
barter drops contains 1 emerald
barter drops contains 1 diamond
barter drops contains 1 iron ingot
then:
complete objective "add item to barter drops" for {_test}
add 1 iron ingot to barter drops
if:
size of barter drops is 3
barter drops contains 1 emerald
barter drops contains 1 diamond
barter drops contains 1 iron ingot
then:
complete objective "add item to barter drops" for {_test}

remove iron ingot from barter drops
if:
size of barter drops is 2
barter drops contains 1 emerald
barter drops contains 1 diamond
then:
complete objective "remove item from barter drops" for {_test}
remove iron ingot from barter drops
if:
size of barter drops is 2
barter drops contains 1 emerald
barter drops contains 1 diamond
then:
complete objective "remove item from barter drops" for {_test}

add 1 dirt and 2 dirt to barter drops
if:
size of barter drops is 4
barter drops contains 1 emerald
barter drops contains 1 diamond
barter drops contains 1 dirt
barter drops contains 2 dirt
then:
complete objective "add multiple items to barter drops" for {_test}
add 1 dirt and 2 dirt to barter drops
if:
size of barter drops is 4
barter drops contains 1 emerald
barter drops contains 1 diamond
barter drops contains 1 dirt
barter drops contains 2 dirt
then:
complete objective "add multiple items to barter drops" for {_test}

remove all dirt from barter drops
if:
size of barter drops is 2
barter drops contains 1 emerald
barter drops contains 1 diamond
then:
complete objective "remove all of an item from barter drops" for {_test}
remove all dirt from barter drops
if:
size of barter drops is 2
barter drops contains 1 emerald
barter drops contains 1 diamond
then:
complete objective "remove all of an item from barter drops" for {_test}

remove 1 emerald and 1 diamond from barter drops
if size of barter drops is 0:
complete objective "remove multiple items from barter drops" for {_test}
remove 1 emerald and 1 diamond from barter drops
if size of barter drops is 0:
complete objective "remove multiple items from barter drops" for {_test}

complete objective "barter drops test complete" for {_test}
complete objective "barter drops test complete" for {_test}

0 comments on commit 8772dd5

Please sign in to comment.