Skip to content

Commit 3d0ca60

Browse files
committed
Update literal multiple infos warning.sk
1 parent f917fde commit 3d0ca60

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

src/test/skript/tests/misc/literal multiple infos warning.sk

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
options:
2-
error: "'unknown' has multiple types (inventory action, click type, damage cause, teleport cause, heal reason, inventory close reason, transform reason, unleash reason, entity potion cause). Consider specifying which type to use: 'unknown (inventory action)'"
2+
error: "'unknown' has multiple types \(.*\)\. Consider specifying which type to use: 'unknown \(.*\)'"
33

44
using for each loops
55

@@ -12,30 +12,30 @@ parse:
1212
test "literal multiple infos warning":
1313
parse:
1414
set {_test} to unknown
15-
assert last parse logs contains {@error} with "Setting variable should throw warning"
15+
assert last parse logs matches {@error} with "Setting variable should throw warning"
1616

1717
parse:
1818
if {_list::*} contains unknown:
1919
broadcast "Filler"
20-
assert last parse logs contains {@error} with "Contains should throw warning"
20+
assert last parse logs matches {@error} with "Contains should throw warning"
2121

2222
parse:
2323
if the 1st element of {_list::*} is unknown:
2424
broadcast "filler"
25-
assert last parse logs contains {@error} with "Element of should throw warning"
25+
assert last parse logs matches {@error} with "Element of should throw warning"
2626

2727
parse:
2828
filter {_list::*} to match:
2929
input is unknown
30-
assert last parse logs contains {@error} with "Filtering should throw warning"
30+
assert last parse logs matches {@error} with "Filtering should throw warning"
3131

3232
parse:
3333
for each {_value} in {_list::*}:
3434
if {_value} is unknown:
3535
broadcast "filler"
36-
assert last parse logs contains {@error} with "For each should throw warning"
36+
assert last parse logs matches {@error} with "For each should throw warning"
3737

38-
assert {LiteralMultipleWarn::FunctionObject} contains {@error} with "Function with Object return type should throw warning"
38+
assert {LiteralMultipleWarn::FunctionObject} matches {@error} with "Function with Object return type should throw warning"
3939
clear {LiteralMultipleWarn::*}
4040

4141
parse:
@@ -52,8 +52,17 @@ parse:
5252
return unknown
5353

5454
test "literal multiple infos no warning":
55-
assert {LiteralMultipleNoWarn::Damage} does not contain {@error} with "Condition check against shared type should not throw warning"
56-
assert {LiteralMultipleNoWarn::FunctionDamageCause} does not contain {@error} with "Function with shared return type should not throw warning"
55+
if all:
56+
{LiteralMultipleNoWarn::Damage} is set
57+
{LiteralMultipleNoWarn::Damage} matches {@error}
58+
then:
59+
assert true is false with "Condition check against shared type should not throw warning"
60+
61+
if all:
62+
{LiteralMultipleNoWarn::FunctionDamageCause} is set
63+
{LiteralMultipleNoWarn::FunctionDamageCause} matches {@error}
64+
then:
65+
assert true is false with "Function with shared return type should not throw warning"
5766
clear {LiteralMultipleNoWarn::*}
5867

5968
parse:

0 commit comments

Comments
 (0)