Reorganize tests into a real spec suite

This commit is contained in:
2024-08-04 19:18:43 -03:00
parent 57c160173c
commit e7c2053222
693 changed files with 136 additions and 116 deletions

View File

@ -0,0 +1,173 @@
---input---
#> Get: #rx.playerdb:api/v2/get
#>
#> @input
#> $in.uid rx.io
#>
#> @output
#> rx.playerdb:io player
#
# Selects data inside the database and copies to rx.playerdb:io player
# See #api/v2/select for more info..
#
#* Note: something, something, this is important..
# Normal Comment
# This **shouldn't** be a comment..
scoreboard players operation @s obj = #fakeplayer obj
#> single line block comment
tellraw @a "This string # has # hashtags o_O"
---tokens---
'#>' Comment.Multiline
' ' Text.Whitespace
'Get:' Literal.String.Doc
' ' Text.Whitespace
'#rx.playerdb:api/v2/get' Name.Function
'\n' Text
'#>' Comment.Multiline
'\n' Text
'#>' Comment.Multiline
' ' Text.Whitespace
'@input' Name.Decorator
'\n' Text
'#>' Comment.Multiline
' ' Text.Whitespace
'$in.uid' Name.Variable.Magic
' ' Text.Whitespace
'rx.io' Literal.String.Doc
'\n' Text
'#>' Comment.Multiline
'\n' Text
'#>' Comment.Multiline
' ' Text.Whitespace
'@output' Name.Decorator
'\n' Text
'#>' Comment.Multiline
' ' Text.Whitespace
'rx.playerdb:io' Name.Function
' ' Text.Whitespace
'player' Literal.String.Doc
'\n' Text
'#' Comment.Multiline
'\n' Text
'#' Comment.Multiline
' ' Text.Whitespace
'Selects' Comment.Multiline
' ' Text.Whitespace
'data' Comment.Multiline
' ' Text.Whitespace
'inside' Comment.Multiline
' ' Text.Whitespace
'the' Comment.Multiline
' ' Text.Whitespace
'database' Comment.Multiline
' ' Text.Whitespace
'and' Comment.Multiline
' ' Text.Whitespace
'copies' Comment.Multiline
' ' Text.Whitespace
'to' Comment.Multiline
' ' Text.Whitespace
'rx.playerdb:io' Name.Function
' ' Text.Whitespace
'player' Comment.Multiline
'\n' Text
'#' Comment.Multiline
' ' Text.Whitespace
'See' Comment.Multiline
' ' Text.Whitespace
'#api/v2/select' Name.Function
' ' Text.Whitespace
'for' Comment.Multiline
' ' Text.Whitespace
'more' Comment.Multiline
' ' Text.Whitespace
'info..' Comment.Multiline
'\n' Text
'#' Comment.Multiline
' \n' Text.Whitespace
'#*' Comment.Multiline
' ' Text.Whitespace
'Note:' Comment.Multiline
' ' Text.Whitespace
'something,' Comment.Multiline
' ' Text.Whitespace
'something,' Comment.Multiline
' ' Text.Whitespace
'this' Comment.Multiline
' ' Text.Whitespace
'is' Comment.Multiline
' ' Text.Whitespace
'important..' Comment.Multiline
'\n' Text
'\n#' Comment.Multiline
' ' Text.Whitespace
'Normal' Comment.Multiline
' ' Text.Whitespace
'Comment' Comment.Multiline
'\n' Text
'\n#' Comment.Multiline
' ' Text.Whitespace
'This' Comment.Multiline
' ' Text.Whitespace
"**shouldn't**" Comment.Multiline
' ' Text.Whitespace
'be' Comment.Multiline
' ' Text.Whitespace
'a' Comment.Multiline
' ' Text.Whitespace
'comment..' Comment.Multiline
'\n' Text
'scoreboard' Name.Builtin
' ' Text.Whitespace
'players' Keyword.Constant
' ' Text.Whitespace
'operation' Keyword.Constant
' ' Text.Whitespace
'@s' Name.Variable
' ' Text.Whitespace
'obj' Keyword.Constant
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'#fakeplayer' Name.Variable.Magic
' ' Text.Whitespace
'obj' Keyword.Constant
'\n\n' Text.Whitespace
'#>' Comment.Multiline
' ' Text.Whitespace
'single' Literal.String.Doc
' ' Text.Whitespace
'line' Literal.String.Doc
' ' Text.Whitespace
'block' Literal.String.Doc
' ' Text.Whitespace
'comment' Literal.String.Doc
'\n' Text
'tellraw' Name.Builtin
' ' Text.Whitespace
'@a' Name.Variable
' ' Text.Whitespace
'"' Literal.String.Double
'This string # has # hashtags o_O' Literal.String.Double
'"' Literal.String.Double
'\n' Text.Whitespace

View File

@ -0,0 +1,188 @@
---input---
# normal
tp 1 2 3
tp 100.5 80 -100.5
# relative
tp 10 ~ -10
tp 10 ~10 -10
tp 10 ~0.5 -10
tp 10 ~.5 -10
tp 10 ~-10 -10
tp 10 ~-0.5 -10
tp 10 ~-.5 -10
# carrot
tp 10 ^ -10
tp 10 ^10 -10
tp 10 ^0.5 -10
tp 10 ^.5 -10
tp 10 ^-10 -10
tp 10 ^-0.5 -10
tp 10 ^-.5 -10
---tokens---
'# normal' Comment.Single
'\n' Text.Whitespace
'tp' Name.Builtin
' ' Text.Whitespace
'1' Literal.Number.Float
' ' Text.Whitespace
'2' Literal.Number.Float
' ' Text.Whitespace
'3' Literal.Number.Float
'\n' Text.Whitespace
'tp' Name.Builtin
' ' Text.Whitespace
'100.5' Literal.Number.Float
' ' Text.Whitespace
'80' Literal.Number.Float
' ' Text.Whitespace
'-100.5' Literal.Number.Float
'\n\n' Text.Whitespace
'# relative' Comment.Single
'\n' Text.Whitespace
'tp' Name.Builtin
' ' Text.Whitespace
'10' Literal.Number.Float
' ' Text.Whitespace
'~' Operator
' ' Text.Whitespace
'-10' Literal.Number.Float
'\n' Text.Whitespace
'tp' Name.Builtin
' ' Text.Whitespace
'10' Literal.Number.Float
' ' Text.Whitespace
'~' Operator
'10' Literal.Number.Float
' ' Text.Whitespace
'-10' Literal.Number.Float
'\n' Text.Whitespace
'tp' Name.Builtin
' ' Text.Whitespace
'10' Literal.Number.Float
' ' Text.Whitespace
'~' Operator
'0.5' Literal.Number.Float
' ' Text.Whitespace
'-10' Literal.Number.Float
'\n' Text.Whitespace
'tp' Name.Builtin
' ' Text.Whitespace
'10' Literal.Number.Float
' ' Text.Whitespace
'~' Operator
'.5' Literal.Number.Float
' ' Text.Whitespace
'-10' Literal.Number.Float
'\n' Text.Whitespace
'tp' Name.Builtin
' ' Text.Whitespace
'10' Literal.Number.Float
' ' Text.Whitespace
'~' Operator
'-10' Literal.Number.Float
' ' Text.Whitespace
'-10' Literal.Number.Float
'\n' Text.Whitespace
'tp' Name.Builtin
' ' Text.Whitespace
'10' Literal.Number.Float
' ' Text.Whitespace
'~' Operator
'-0.5' Literal.Number.Float
' ' Text.Whitespace
'-10' Literal.Number.Float
'\n' Text.Whitespace
'tp' Name.Builtin
' ' Text.Whitespace
'10' Literal.Number.Float
' ' Text.Whitespace
'~' Operator
'-.5' Literal.Number.Float
' ' Text.Whitespace
'-10' Literal.Number.Float
'\n\n' Text.Whitespace
'# carrot' Comment.Single
'\n' Text.Whitespace
'tp' Name.Builtin
' ' Text.Whitespace
'10' Literal.Number.Float
' ' Text.Whitespace
'^' Operator
' ' Text.Whitespace
'-10' Literal.Number.Float
'\n' Text.Whitespace
'tp' Name.Builtin
' ' Text.Whitespace
'10' Literal.Number.Float
' ' Text.Whitespace
'^' Operator
'10' Literal.Number.Float
' ' Text.Whitespace
'-10' Literal.Number.Float
'\n' Text.Whitespace
'tp' Name.Builtin
' ' Text.Whitespace
'10' Literal.Number.Float
' ' Text.Whitespace
'^' Operator
'0.5' Literal.Number.Float
' ' Text.Whitespace
'-10' Literal.Number.Float
'\n' Text.Whitespace
'tp' Name.Builtin
' ' Text.Whitespace
'10' Literal.Number.Float
' ' Text.Whitespace
'^' Operator
'.5' Literal.Number.Float
' ' Text.Whitespace
'-10' Literal.Number.Float
'\n' Text.Whitespace
'tp' Name.Builtin
' ' Text.Whitespace
'10' Literal.Number.Float
' ' Text.Whitespace
'^' Operator
'-10' Literal.Number.Float
' ' Text.Whitespace
'-10' Literal.Number.Float
'\n' Text.Whitespace
'tp' Name.Builtin
' ' Text.Whitespace
'10' Literal.Number.Float
' ' Text.Whitespace
'^' Operator
'-0.5' Literal.Number.Float
' ' Text.Whitespace
'-10' Literal.Number.Float
'\n' Text.Whitespace
'tp' Name.Builtin
' ' Text.Whitespace
'10' Literal.Number.Float
' ' Text.Whitespace
'^' Operator
'-.5' Literal.Number.Float
' ' Text.Whitespace
'-10' Literal.Number.Float
'\n' Text.Whitespace

View File

@ -0,0 +1,120 @@
---input---
data modify storage my:storage root set value {
key: "This NBT Compound is multiple lines",
Count: 10b,
tags: [
0,
1,
],
UUID
}
tellraw @a {
"text": "how ever",
"color": "blue",
"extra": [
"this is json o_O"
]
}
---tokens---
'data' Name.Builtin
' ' Text.Whitespace
'modify' Keyword.Constant
' ' Text.Whitespace
'storage' Keyword.Constant
' ' Text.Whitespace
'my:storage' Name.Function
' ' Text.Whitespace
'root' Keyword.Constant
' ' Text.Whitespace
'set' Keyword.Constant
' ' Text.Whitespace
'value' Keyword.Constant
' ' Text.Whitespace
'{' Punctuation
'\n ' Text.Whitespace
'key' Name.Attribute
':' Punctuation
' ' Text.Whitespace
'"' Literal.String.Double
'This NBT Compound is multiple lines' Literal.String.Double
'"' Literal.String.Double
',' Punctuation
'\n ' Text.Whitespace
'Count' Name.Attribute
':' Punctuation
' ' Text.Whitespace
'10' Literal.Number.Integer
'b' Name.Attribute
',' Punctuation
'\n ' Text.Whitespace
'tags' Name.Attribute
':' Punctuation
' ' Text.Whitespace
'[' Punctuation
'\n ' Text.Whitespace
'0' Literal.Number.Integer
',' Punctuation
'\n ' Text.Whitespace
'1' Literal.Number.Integer
',' Punctuation
'\n ' Text.Whitespace
']' Punctuation
',' Punctuation
'\n ' Text.Whitespace
'UUID' Name.Attribute
'\n' Text.Whitespace
'}' Punctuation
'\n\n' Text.Whitespace
'tellraw' Name.Builtin
' ' Text.Whitespace
'@a' Name.Variable
' ' Text.Whitespace
'{' Punctuation
'\n ' Text.Whitespace
'"' Name.Attribute
'text' Name.Attribute
'"' Name.Attribute
':' Punctuation
' ' Text.Whitespace
'"' Literal.String.Double
'how ever' Literal.String.Double
'"' Literal.String.Double
',' Punctuation
'\n ' Text.Whitespace
'"' Name.Attribute
'color' Name.Attribute
'"' Name.Attribute
':' Punctuation
' ' Text.Whitespace
'"' Literal.String.Double
'blue' Literal.String.Double
'"' Literal.String.Double
',' Punctuation
'\n ' Text.Whitespace
'"' Name.Attribute
'extra' Name.Attribute
'"' Name.Attribute
':' Punctuation
' ' Text.Whitespace
'[' Punctuation
'\n ' Text.Whitespace
'"' Name.Attribute
'this' Name.Attribute
' ' Text.Whitespace
'is' Name.Attribute
' ' Text.Whitespace
'json' Name.Attribute
' ' Text.Whitespace
'o_' Name.Attribute
'O' Name.Attribute
'"' Name.Attribute
'\n ' Text.Whitespace
']' Punctuation
'\n' Text.Whitespace
'}' Punctuation
'\n' Text.Whitespace

View File

@ -0,0 +1,56 @@
---input---
# execute as @e[nbt={ Item: {id: "minecraft:diamond", Count: 64 } }] run
# setblock ~ ~ ~ minecraft:dispenser[facing=up]{Items: [{id: "minecraft:diamond", Count: 1}]}
# tellraw @a [{"text": "hello", "color": "blue"}, {"text": "world", "color": "blue"}]
execute as @a[advancements={minecraft:story/form_obsidian={foo=true, bar=false},minecraft:story/follow_ender_eye={foo=false, bar=true}}] run
---tokens---
'# execute as @e[nbt={ Item: {id: "minecraft:diamond", Count: 64 } }] run' Comment.Single
'\n' Text.Whitespace
'# setblock ~ ~ ~ minecraft:dispenser[facing=up]{Items: [{id: "minecraft:diamond", Count: 1}]}' Comment.Single
'\n' Text.Whitespace
'# tellraw @a [{"text": "hello", "color": "blue"}, {"text": "world", "color": "blue"}]' Comment.Single
'\n\n' Text.Whitespace
'execute' Name.Builtin
' ' Text.Whitespace
'as' Keyword.Constant
' ' Text.Whitespace
'@a' Name.Variable
'[' Punctuation
'advancements' Name.Attribute
'=' Punctuation
'{' Punctuation
'minecraft:story/form_obsidian' Name.Attribute
'=' Punctuation
'{' Punctuation
'foo' Name.Attribute
'=' Punctuation
'true' Name.Tag
',' Punctuation
' ' Text.Whitespace
'bar' Name.Attribute
'=' Punctuation
'false' Name.Tag
'}' Punctuation
',' Punctuation
'minecraft:story/follow_ender_eye' Name.Attribute
'=' Punctuation
'{' Punctuation
'foo' Name.Attribute
'=' Punctuation
'false' Name.Tag
',' Punctuation
' ' Text.Whitespace
'bar' Name.Attribute
'=' Punctuation
'true' Name.Tag
'}' Punctuation
'}' Punctuation
']' Punctuation
' ' Text.Whitespace
'run' Keyword.Constant
'\n' Text.Whitespace

View File

@ -0,0 +1,108 @@
---input---
execute
as @a # For each "player",
at @s # start at their feet.
anchored eyes # Looking through their eyes,
facing 0 0 0 # face perfectly at the target
anchored feet # (go back to the feet)
positioned ^ ^ ^1 # and move one block forward.
rotated as @s # Face the direction the player
# is actually facing,
positioned ^ ^ ^-1 # and move one block back.
if entity @s[distance=..0.6] # Check if we're close to the
# player's feet.
run
say "I'm facing the target!"
---tokens---
'execute' Name.Builtin
'\n ' Text.Whitespace
'as' Keyword.Constant
' ' Text.Whitespace
'@a' Name.Variable
' ' Text.Whitespace
'# For each "player",' Comment.Single
'\n ' Text.Whitespace
'at' Keyword.Constant
' ' Text.Whitespace
'@s' Name.Variable
' ' Text.Whitespace
'# start at their feet.' Comment.Single
'\n ' Text.Whitespace
'anchored' Keyword.Constant
' ' Text.Whitespace
'eyes' Keyword.Constant
' ' Text.Whitespace
'# Looking through their eyes,' Comment.Single
'\n ' Text.Whitespace
'facing' Keyword.Constant
' ' Text.Whitespace
'0' Literal.Number.Float
' ' Text.Whitespace
'0' Literal.Number.Float
' ' Text.Whitespace
'0' Literal.Number.Float
' ' Text.Whitespace
'# face perfectly at the target' Comment.Single
'\n ' Text.Whitespace
'anchored' Keyword.Constant
' ' Text.Whitespace
'feet' Keyword.Constant
' ' Text.Whitespace
'# (go back to the feet)' Comment.Single
'\n ' Text.Whitespace
'positioned' Keyword.Constant
' ' Text.Whitespace
'^' Operator
' ' Text.Whitespace
'^' Operator
' ' Text.Whitespace
'^' Operator
'1' Literal.Number.Float
' ' Text.Whitespace
'# and move one block forward.' Comment.Single
'\n ' Text.Whitespace
'rotated' Keyword.Constant
' ' Text.Whitespace
'as' Keyword.Constant
' ' Text.Whitespace
'@s' Name.Variable
' ' Text.Whitespace
'# Face the direction the player' Comment.Single
'\n ' Text.Whitespace
'# is actually facing,' Comment.Single
'\n ' Text.Whitespace
'positioned' Keyword.Constant
' ' Text.Whitespace
'^' Operator
' ' Text.Whitespace
'^' Operator
' ' Text.Whitespace
'^' Operator
'-1' Literal.Number.Float
' ' Text.Whitespace
'# and move one block back.' Comment.Single
'\n ' Text.Whitespace
'if' Keyword.Constant
' ' Text.Whitespace
'entity' Keyword.Constant
' ' Text.Whitespace
'@s' Name.Variable
'[' Punctuation
'distance' Name.Attribute
'=' Punctuation
'..' Literal
'0.6' Literal.Number.Float
']' Punctuation
' ' Text.Whitespace
"# Check if we're close to the" Comment.Single
'\n ' Text.Whitespace
"# player's feet." Comment.Single
'\n ' Text.Whitespace
'run' Keyword.Constant
' \n say' Name.Builtin
' ' Text.Whitespace
'"' Literal.String.Double
"I'm facing the target!" Literal.String.Double
'"' Literal.String.Double
'\n' Text.Whitespace

View File

@ -0,0 +1,73 @@
---input---
execute
as @a[
advancements={
minecraft:story/form_obsidian={
foo=true,
bar=false
},
minecraft:story/follow_ender_eye={
foo=false, bar=true
}
}
] run
say this command is nuts
---tokens---
'execute' Name.Builtin
'\n ' Text.Whitespace
'as' Keyword.Constant
' ' Text.Whitespace
'@a' Name.Variable
'[' Punctuation
'\n ' Text.Whitespace
'advancements' Name.Attribute
'=' Punctuation
'{' Punctuation
'\n ' Text.Whitespace
'minecraft:story/form_obsidian' Name.Attribute
'=' Punctuation
'{' Punctuation
'\n ' Text.Whitespace
'foo' Name.Attribute
'=' Punctuation
'true' Name.Tag
',' Punctuation
'\n ' Text.Whitespace
'bar' Name.Attribute
'=' Punctuation
'false' Name.Tag
'\n ' Text.Whitespace
'}' Punctuation
',' Punctuation
'\n ' Text.Whitespace
'minecraft:story/follow_ender_eye' Name.Attribute
'=' Punctuation
'{' Punctuation
'\n ' Text.Whitespace
'foo' Name.Attribute
'=' Punctuation
'false' Name.Tag
',' Punctuation
' ' Text.Whitespace
'bar' Name.Attribute
'=' Punctuation
'true' Name.Tag
'\n ' Text.Whitespace
'}' Punctuation
'\n ' Text.Whitespace
'}' Punctuation
'\n ' Text.Whitespace
']' Punctuation
' ' Text.Whitespace
'run' Keyword.Constant
'\n say' Name.Builtin
' ' Text.Whitespace
'this' Keyword.Constant
' ' Text.Whitespace
'command' Keyword.Constant
' ' Text.Whitespace
'is' Keyword.Constant
' ' Text.Whitespace
'nuts' Keyword.Constant
'\n' Text.Whitespace

View File

@ -0,0 +1,92 @@
---input---
#> This command looks for a player with 10 hp and prints a message
# @param - @s = player
execute as @a[name="rx", nbt={Health: 10.0f}] run tellraw @a {"text": "this is my cool command"} # epic
---tokens---
'#>' Comment.Multiline
' ' Text.Whitespace
'This' Literal.String.Doc
' ' Text.Whitespace
'command' Literal.String.Doc
' ' Text.Whitespace
'looks' Literal.String.Doc
' ' Text.Whitespace
'for' Literal.String.Doc
' ' Text.Whitespace
'a' Literal.String.Doc
' ' Text.Whitespace
'player' Literal.String.Doc
' ' Text.Whitespace
'with' Literal.String.Doc
' ' Text.Whitespace
'10' Literal.String.Doc
' ' Text.Whitespace
'hp' Literal.String.Doc
' ' Text.Whitespace
'and' Literal.String.Doc
' ' Text.Whitespace
'prints' Literal.String.Doc
' ' Text.Whitespace
'a' Literal.String.Doc
' ' Text.Whitespace
'message' Literal.String.Doc
'\n' Text
'#' Comment.Multiline
' ' Text.Whitespace
'@param' Name.Decorator
' ' Text.Whitespace
'-' Comment.Multiline
' ' Text.Whitespace
'@s' Name.Decorator
' ' Text.Whitespace
'=' Comment.Multiline
' ' Text.Whitespace
'player' Comment.Multiline
'\n' Text
'\n' Text.Whitespace
'execute' Name.Builtin
' ' Text.Whitespace
'as' Keyword.Constant
' ' Text.Whitespace
'@a' Name.Variable
'[' Punctuation
'name' Name.Attribute
'=' Punctuation
'"' Literal.String.Double
'rx' Literal.String.Double
'"' Literal.String.Double
',' Punctuation
' ' Text.Whitespace
'nbt' Name.Attribute
'=' Punctuation
'{' Punctuation
'Health' Name.Attribute
':' Punctuation
' ' Text.Whitespace
'10.0f' Literal.Number.Float
'}' Punctuation
']' Punctuation
' ' Text.Whitespace
'run' Keyword.Constant
' tellraw' Name.Builtin
' ' Text.Whitespace
'@a' Name.Variable
' ' Text.Whitespace
'{' Punctuation
'"' Name.Attribute
'text' Name.Attribute
'"' Name.Attribute
':' Punctuation
' ' Text.Whitespace
'"' Literal.String.Double
'this is my cool command' Literal.String.Double
'"' Literal.String.Double
'}' Punctuation
' ' Text.Whitespace
'# epic' Comment.Single
'\n' Text.Whitespace