Skip to content
This repository was archived by the owner on Dec 8, 2025. It is now read-only.

Commit 2780652

Browse files
committed
Update tests and snapshots
1 parent 0d8c00c commit 2780652

File tree

40 files changed

+256
-219
lines changed

40 files changed

+256
-219
lines changed

tests/resources/argument_examples.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,13 @@
145145
"{\"text\":\"hello world\"}",
146146
"[\"\"]",
147147
"\"\\u2588\"",
148-
"{\"\\u2588\\\"\\n\":[123]}"
148+
"{\"\\u2588\\\"\\n\":[123]}",
149+
"wat"
149150
]
150151
},
151152
{
152153
"invalid": true,
153-
"examples": ["wat", "{\"hey\": ]}"]
154+
"examples": ["{\"hey\": ]}"]
154155
}
155156
],
156157
"minecraft:dimension": [
@@ -415,18 +416,18 @@
415416
"[L;1l,2l]",
416417
"[a, b, c]",
417418
"[[], [1], [foo]]",
418-
"[[],[[[[[[[[[[],[[[[5,1]],[]]]]]]]]]]],[[[[]]]]]]"
419+
"[[],[[[[[[[[[[],[[[[5,1]],[]]]]]]]]]]],[[[[]]]]]]",
420+
"\"\\n\"",
421+
"[a,1]",
422+
"[[],[],1b]"
419423
]
420424
},
421425
{
422426
"invalid": true,
423427
"examples": [
424428
"\"\\\"",
425-
"\"\\n\"",
426429
"\"\\\\\\\"",
427430
"{\"\\\":1}",
428-
"[a,1]",
429-
"[[],[],1b]",
430431
"[B;5l,4l,3]",
431432
"[I;5l,4l,3]",
432433
"[L;5l,4l,3]",

tests/snapshots/examples__build_basic_formatting__0.pack.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
```mcfunction
2121
say this is a test
2222
execute as @a[nbt={SelectedItem:{id:"minecraft:diamond",Count:64b}}] at @s run setblock ~ ~ ~ repeater[delay=3,facing=south]
23-
tellraw @a ["",{"text":"hello","color":"red"},"not ascii: \u00b6"]
23+
tellraw @a ["",{text:"hello",color:"red"},"not ascii: "]
2424
say goodbye
2525
```
2626

@@ -29,7 +29,7 @@ say goodbye
2929
```mcfunction
3030
say this is a test
3131
execute as @a[nbt={SelectedItem: {id: "minecraft:diamond", Count: 64b}}] at @s run setblock ~ ~ ~ repeater[delay=3, facing=south]
32-
tellraw @a ["", {"text": "hello", "color": "red"}, "not ascii: \u00b6"]
32+
tellraw @a ["", {text: "hello", color: "red"}, "not ascii: "]
3333
say goodbye
3434
```
3535

@@ -44,7 +44,7 @@ execute as @a[nbt={SelectedItem: {id: "minecraft:diamond", Count: 64b}}] at @s r
4444
4545
4646
47-
tellraw @a ["", {"text": "hello", "color": "red"}, "not ascii: \u00b6"]
47+
tellraw @a ["", {text: "hello", color: "red"}, "not ascii: "]
4848
4949
5050
@@ -63,7 +63,7 @@ execute as @a[nbt={SelectedItem:{id:"minecraft:diamond",Count:64b}}] at @s run s
6363
6464
6565
66-
tellraw @a ["", {"color": "red", "text": "hello"}, "not ascii: ¶"]
66+
tellraw @a ["",{text:"hello",color:"red"},"not ascii: ¶"]
6767
6868
6969

tests/snapshots/examples__build_basic_json__0.pack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
`@function demo:foo`
1919

2020
```mcfunction
21-
tellraw @p {"text": "empty"}
21+
tellraw @p {text: "empty"}
2222
```
2323

2424
`@loot_table demo:foo`

tests/snapshots/examples__build_basic_nested_yaml__0.pack.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
`@function demo:foo`
1919

2020
```mcfunction
21-
tellraw @a ["", {"text": "hello", "color": "red"}]
22-
tellraw @a ["", {"text": "hello", "color": "red"}]
21+
tellraw @a ["", {text: "hello", color: "red"}]
22+
tellraw @a ["", {text: "hello", color: "red"}]
2323
summon armor_stand ~ ~ ~ {Tags: ["position_history", "new"], Invisible: 1b, Marker: 1b}
2424
summon armor_stand ~ ~ ~ {Tags: ["position_history", "new"], Invisible: 1b, Marker: 1b}
25-
tellraw @s {"text": "Hover me!", "hoverEvent": {"action": "show_text", "value": "Hi!"}}
26-
tellraw @a {"text": "Hello # there"}
27-
tellraw @a {"text": "Hello\" # \"there"}
28-
data merge storage demo:foo {custom_stuff: {list_of_lists: [[0, 0, 0], [1, 1, 1]], normal_lists: [[0, 0, 0], [1, 1, 1]]}, something_else: [{type: "foo", foo: 42}, {type: "bar", bar: 99}], byte_array: [B; 1B, 1B, 0B, 1B], item1: {id: "player_head", count: 1b, components: {"minecraft:profile": "herobrine"}}, item2: {id: "player_head", count: 1b, components: {"minecraft:profile": "herobrine"}}}
25+
tellraw @s {text: "Hover me!", hoverEvent: {action: "show_text", value: "Hi!"}}
26+
tellraw @a {text: "Hello # there"}
27+
tellraw @a {text: 'Hello" # "there'}
28+
data merge storage demo:foo {custom_stuff: {list_of_lists: [[0, 0, 0], [1, 1, 1]], normal_lists: [[0, 0, 0], [1, 1, 1]]}, something_else: [{type: "foo", foo: 42}, {type: "bar", bar: 99}], byte_array: [B; 1b, 1b, 0b, 1b], item1: {id: "player_head", count: 1b, components: {"minecraft:profile": "herobrine"}}, item2: {id: "player_head", count: 1b, components: {"minecraft:profile": "herobrine"}}}
2929
```

tests/snapshots/examples__build_basic_preserve__0.pack.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ execute as @a at @s align xyz if block ~ ~ ~ wool[foo=bar] run summon armor_stan
5050
# consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
5151
# cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
5252
# non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
53-
tellraw @s {"text": "Hover me!", "hoverEvent": {"action": "show_text", "value": "Hi!"}}
53+
tellraw @s {text: "Hover me!", hoverEvent: {action: "show_text", value: "Hi!"}}
5454
5555
# The hover event is cool
5656
@@ -84,7 +84,7 @@ execute as @a at @s if block ~ ~-1 ~ #wool run give @s stone{display: {Name: '[{
8484
execute if block ~ ~ ~ #namespace:tag if entity @s[tag=foo]
8585
8686
87-
tellraw @a {"text": "Hello # there"}
87+
tellraw @a {text: "Hello # there"}
8888
8989
9090

tests/snapshots/parse__argument_examples_minecraft_component_0_0__0.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ minecraft:component 0 0
66
---
77
"hello world"
88
---
9-
<class 'mecha.ast.AstJsonValue'>
9+
<class 'mecha.ast.AstNbtValue'>
1010
location: SourceLocation(pos=0, lineno=1, colno=1)
1111
end_location: SourceLocation(pos=13, lineno=1, colno=14)
12-
value: 'hello world'
12+
value: String('hello world')

tests/snapshots/parse__argument_examples_minecraft_component_0_1__0.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ minecraft:component 0 1
66
---
77
""
88
---
9-
<class 'mecha.ast.AstJsonValue'>
9+
<class 'mecha.ast.AstNbtValue'>
1010
location: SourceLocation(pos=0, lineno=1, colno=1)
1111
end_location: SourceLocation(pos=2, lineno=1, colno=3)
12-
value: ''
12+
value: String('')

tests/snapshots/parse__argument_examples_minecraft_component_0_2__0.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ minecraft:component 0 2
44
---
55
{"text":"hello world"}
66
---
7-
{"text": "hello world"}
7+
{text: "hello world"}
88
---
9-
<class 'mecha.ast.AstJsonObject'>
9+
<class 'mecha.ast.AstNbtCompound'>
1010
location: SourceLocation(pos=0, lineno=1, colno=1)
1111
end_location: SourceLocation(pos=22, lineno=1, colno=23)
1212
entries:
13-
<class 'mecha.ast.AstJsonObjectEntry'>
13+
<class 'mecha.ast.AstNbtCompoundEntry'>
1414
location: SourceLocation(pos=1, lineno=1, colno=2)
1515
end_location: SourceLocation(pos=21, lineno=1, colno=22)
1616
key:
17-
<class 'mecha.ast.AstJsonObjectKey'>
17+
<class 'mecha.ast.AstNbtCompoundKey'>
1818
location: SourceLocation(pos=1, lineno=1, colno=2)
1919
end_location: SourceLocation(pos=7, lineno=1, colno=8)
2020
value: 'text'
2121
value:
22-
<class 'mecha.ast.AstJsonValue'>
22+
<class 'mecha.ast.AstNbtValue'>
2323
location: SourceLocation(pos=8, lineno=1, colno=9)
2424
end_location: SourceLocation(pos=21, lineno=1, colno=22)
25-
value: 'hello world'
25+
value: String('hello world')

tests/snapshots/parse__argument_examples_minecraft_component_0_3__0.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ minecraft:component 0 3
66
---
77
[""]
88
---
9-
<class 'mecha.ast.AstJsonArray'>
9+
<class 'mecha.ast.AstNbtList'>
1010
location: SourceLocation(pos=0, lineno=1, colno=1)
1111
end_location: SourceLocation(pos=4, lineno=1, colno=5)
1212
elements:
13-
<class 'mecha.ast.AstJsonValue'>
13+
<class 'mecha.ast.AstNbtValue'>
1414
location: SourceLocation(pos=1, lineno=1, colno=2)
1515
end_location: SourceLocation(pos=3, lineno=1, colno=4)
16-
value: ''
16+
value: String('')

tests/snapshots/parse__argument_examples_minecraft_component_0_4__0.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ minecraft:component 0 4
44
---
55
"\u2588"
66
---
7-
"\u2588"
7+
""
88
---
9-
<class 'mecha.ast.AstJsonValue'>
9+
<class 'mecha.ast.AstNbtValue'>
1010
location: SourceLocation(pos=0, lineno=1, colno=1)
1111
end_location: SourceLocation(pos=8, lineno=1, colno=9)
12-
value: '█'
12+
value: String('█')

0 commit comments

Comments
 (0)