From 91ca97a8c48c1acc096960cbe5ddce1b18c13c03 Mon Sep 17 00:00:00 2001 From: F1r3w477 Date: Mon, 21 Jul 2025 08:29:52 -0500 Subject: [PATCH 1/4] add tests --- .../syntaxes/expressions/ExprActiveItem.sk | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/test/skript/tests/syntaxes/expressions/ExprActiveItem.sk diff --git a/src/test/skript/tests/syntaxes/expressions/ExprActiveItem.sk b/src/test/skript/tests/syntaxes/expressions/ExprActiveItem.sk new file mode 100644 index 00000000000..d0c812f656b --- /dev/null +++ b/src/test/skript/tests/syntaxes/expressions/ExprActiveItem.sk @@ -0,0 +1,20 @@ +test "Active Item Expression": + spawn a cow at test-location: + set {_cow} to entity + assert active item of {_cow} is not set with "A cow that is not using an item should have no active item" + clear entity within {_cow} + +test "Active Item Plurality": + clear {_cows::*} + spawn 2 cows at test-location: + add entity to {_cows::*} + assert active item of {_cows::*} is not set with "A list of idle entities should return no active items" + clear entities within {_cows::*} + +test "Active Item Aliases": + spawn a cow at test-location: + set {_cow} to entity + assert raised tool of {_cow} is not set with "'raised tool' alias should work" + assert active weapon of {_cow} is not set with "'active weapon' alias should work" + assert {_cow}'s active item is not set with "Possessive syntax should work" + clear entity within {_cow} \ No newline at end of file From 4fd8a2470c5349a6d10cc0e5a79f4d446c25bef3 Mon Sep 17 00:00:00 2001 From: F1r3w477 Date: Mon, 21 Jul 2025 18:35:54 -0500 Subject: [PATCH 2/4] remove unneeded clear --- src/test/skript/tests/syntaxes/expressions/ExprActiveItem.sk | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/skript/tests/syntaxes/expressions/ExprActiveItem.sk b/src/test/skript/tests/syntaxes/expressions/ExprActiveItem.sk index d0c812f656b..2ad4fedcc22 100644 --- a/src/test/skript/tests/syntaxes/expressions/ExprActiveItem.sk +++ b/src/test/skript/tests/syntaxes/expressions/ExprActiveItem.sk @@ -5,7 +5,6 @@ test "Active Item Expression": clear entity within {_cow} test "Active Item Plurality": - clear {_cows::*} spawn 2 cows at test-location: add entity to {_cows::*} assert active item of {_cows::*} is not set with "A list of idle entities should return no active items" From 492f76a873da33f8135038afe8e15d77d3a293ea Mon Sep 17 00:00:00 2001 From: F1r3w477 Date: Wed, 23 Jul 2025 17:00:44 -0500 Subject: [PATCH 3/4] end new line --- src/test/skript/tests/syntaxes/expressions/ExprActiveItem.sk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/skript/tests/syntaxes/expressions/ExprActiveItem.sk b/src/test/skript/tests/syntaxes/expressions/ExprActiveItem.sk index 2ad4fedcc22..1c49db36e91 100644 --- a/src/test/skript/tests/syntaxes/expressions/ExprActiveItem.sk +++ b/src/test/skript/tests/syntaxes/expressions/ExprActiveItem.sk @@ -16,4 +16,4 @@ test "Active Item Aliases": assert raised tool of {_cow} is not set with "'raised tool' alias should work" assert active weapon of {_cow} is not set with "'active weapon' alias should work" assert {_cow}'s active item is not set with "Possessive syntax should work" - clear entity within {_cow} \ No newline at end of file + clear entity within {_cow} From b80a316e5784a6e9d350890484ab7ceedbb59f3f Mon Sep 17 00:00:00 2001 From: F1r3w477 Date: Thu, 24 Jul 2025 13:41:35 -0500 Subject: [PATCH 4/4] restructure --- .../tests/syntaxes/expressions/ExprActiveItem.sk | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/test/skript/tests/syntaxes/expressions/ExprActiveItem.sk b/src/test/skript/tests/syntaxes/expressions/ExprActiveItem.sk index 1c49db36e91..5bf0973fb30 100644 --- a/src/test/skript/tests/syntaxes/expressions/ExprActiveItem.sk +++ b/src/test/skript/tests/syntaxes/expressions/ExprActiveItem.sk @@ -1,19 +1,14 @@ -test "Active Item Expression": +test "Active Item": spawn a cow at test-location: set {_cow} to entity assert active item of {_cow} is not set with "A cow that is not using an item should have no active item" + assert raised tool of {_cow} is not set with "'raised tool' alias should work" + assert active weapon of {_cow} is not set with "'active weapon' alias should work" + assert {_cow}'s active item is not set with "Possessive syntax should work" clear entity within {_cow} -test "Active Item Plurality": +test "Active Item on Multiple Entities": spawn 2 cows at test-location: add entity to {_cows::*} assert active item of {_cows::*} is not set with "A list of idle entities should return no active items" clear entities within {_cows::*} - -test "Active Item Aliases": - spawn a cow at test-location: - set {_cow} to entity - assert raised tool of {_cow} is not set with "'raised tool' alias should work" - assert active weapon of {_cow} is not set with "'active weapon' alias should work" - assert {_cow}'s active item is not set with "Possessive syntax should work" - clear entity within {_cow}