Skip to content

Commit 43767e9

Browse files
committed
tests: add full test suite
1 parent ca02d94 commit 43767e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1660
-0
lines changed

tests/comprehensive/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Comprehensive Test Suite
2+
> *Originally from [language-mcfunction](https://github.com/Arcensoth/language-mcfunction/tree/main/tests)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# test argument types
2+
execute if block ~ ~ ~ minecraft:oak_log[axis=x] run
3+
execute if block ~ ~ ~ minecraft:oak_leaves[distance=5] run
4+
execute if block ~ ~ ~ minecraft:oak_leaves[persistent=true] run
5+
execute if block ~ ~ ~ minecraft:oak_leaves[persistent=false] run
6+
execute if block ~ ~ ~ minecraft:oak_leaves[persistent = false] run
7+
8+
# test multiple arguments
9+
execute if block ~ ~ ~ minecraft:oak_leaves[distance=5,persistent=true] run
10+
11+
# test tagged variant
12+
execute if block ~ ~ ~ #minecraft:leaves[distance=5] run
13+
execute if block ~ ~ ~ #minecraft:leaves[distance=5,persistent=true] run
14+
execute if block ~ ~ ~ #minecraft:leaves[distance=5, persistent=true] run
15+
16+
# test with nbt
17+
setblock ~ ~ ~ mypack:foo{foo:bar} destroy
18+
setblock ~ ~ ~ mypack:foo{foo: bar} destroy
19+
setblock ~ ~ ~ mypack:foo[facing=up]{foo: bar} destroy
20+
setblock ~ ~ ~ mypack:foo[facing = up]{foo: bar} destroy
21+
22+
# test without namespace
23+
setblock ~ ~ ~ foo{foo:bar} destroy
24+
setblock ~ ~ ~ foo[facing=up]{foo: bar} destroy
25+
setblock ~ ~ ~ foo[facing=up] destroy
26+
setblock ~ ~ ~ foo[ facing = up ]{foo: bar} destroy
27+
setblock ~ ~ ~ foo[ facing = up ]{foo: bar} destroy
28+
29+
# invalid
30+
setblock ~ ~ ~ mypack:foo[facing = up]foo destroy
31+
setblock ~ ~ ~ mypack:foo[facing = up]{foo: bar}foo destroy
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
execute
2+
execute foo
3+
execute as
4+
execute as foo
5+
execute as @s
6+
execute as @s foo
7+
execute as @s execute
8+
execute as @s execute as
9+
execute as @s execute as @s
10+
execute as @s as
11+
execute as @s as foo
12+
execute as @s as @s
13+
execute run
14+
execute run foo
15+
execute run execute
16+
execute run execute foo
17+
execute run execute run
18+
execute as @s run
19+
execute as @s run foo
20+
execute as @s run as
21+
execute as @s run as @s
22+
execute as @s run execute
23+
execute as @s run execute foo
24+
execute as @s run execute as @s run
25+
26+
advancement
27+
advancement foo
28+
advancement grant
29+
advancement grant foo
30+
advancement grant targets
31+
advancement grant targets foo
32+
advancement grant targets everything
33+
34+
execute as targets
35+
execute as targets
36+
execute as targets run
37+
execute as targets run
38+
execute as targets run execute
39+
execute as targets run execute
40+
execute as targets run execute as
41+
execute as targets run execute as
42+
execute as targets run execute as targets
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
effect
2+
effect clear
3+
effect clear targets
4+
effect clear targets effect
5+
effect give
6+
effect give targets
7+
effect give targets effect
8+
effect give targets effect seconds
9+
effect give targets effect seconds amplifier
10+
effect give targets effect seconds amplifier hideParticles
11+
12+
# effect
13+
effect
14+
effect
15+
effect foo
16+
17+
# effect clear
18+
effect clear
19+
effect clear s
20+
effect clear @
21+
effect clear @s
22+
effect clear @s
23+
effect clear @s foo
24+
effect clear @s minecraft:foo
25+
effect clear @s strength
26+
effect clear @s minecraft:strength
27+
effect clear @s minecraft:strength
28+
effect give @e[tag=foo] minecraft:strength
29+
effect give Arcensoth minecraft:strength
30+
effect give f7a39418-72ca-4bf2-bc7e-ba9df67a4707 minecraft:strength
31+
effect give @s minecraft:strength/foo
32+
33+
# effect give
34+
effect give
35+
effect give
36+
effect give s
37+
effect give @
38+
effect give @s
39+
effect give @s
40+
effect give @s foo
41+
effect give @s minecraft:foo
42+
effect give @s strength
43+
effect give @s minecraft:strength
44+
effect give @e[tag=foo] minecraft:strength
45+
effect give Arcensoth minecraft:strength
46+
effect give f7a39418-72ca-4bf2-bc7e-ba9df67a4707 minecraft:strength
47+
effect give @s minecraft:strength/foo
48+
effect give @s minecraft:strength
49+
effect give @s minecraft:strength 1
50+
effect give @s minecraft:strength foo
51+
effect give @s minecraft:strength 0
52+
effect give @s minecraft:strength -1
53+
effect give @s minecraft:strength 1
54+
effect give @s minecraft:strength 999999
55+
effect give @s minecraft:strength 999999
56+
effect give @s minecraft:strength 999999 foo
57+
effect give @s minecraft:strength 999999 0
58+
effect give @s minecraft:strength 999999 -1
59+
effect give @s minecraft:strength 999999 1
60+
effect give @s minecraft:strength 999999 127
61+
effect give @s minecraft:strength 999999 127
62+
effect give @s minecraft:strength 999999 127 t
63+
effect give @s minecraft:strength 999999 127 true
64+
effect give @s minecraft:strength 999999 127 false
65+
effect give @s minecraft:strength 999999 127 true
66+
effect give @s minecraft:strength 999999 127 true
67+
effect give @s minecraft:strength 999999 127 true uhoh
68+
69+
effect give @s minecraft:strength
70+
effect give @s minecraft:strength
71+
effect give @s minecraft:strength
72+
effect give @s minecraft:strength
73+
effect give @s minecraft:strength
74+
effect give @s minecraft:strength
75+
effect give @s minecraft:strength 999999
+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#> Raycasting
2+
#
3+
# Casts a ray from starting position along a configurable number
4+
# of blocks with a confugrable accuracy, counting the number of
5+
# entities hit by the ray along the way.
6+
#
7+
# @params
8+
# $mypack.raycast.distance param
9+
# The number of blocks to cast forward.
10+
# $mypack.raycast.precision param
11+
# The ratio of block precision to a full block.
12+
#
13+
# @returns
14+
# $mypack.raycast.result return
15+
# The number of entities hit by the ray.
16+
17+
# @test no longer part of the block comment
18+
execute as @s run say this should not be a comment
19+
20+
execute as @s run say this should also not be a comment
21+
22+
# Non-highlighted block
23+
# @hello this block is not highlighted
24+
# because the first line doesn't have a prefix
25+
26+
#> Another block
27+
# @hello this is another block
28+
# and this is the end
29+
30+
execute as @s run say this should be a command
31+
32+
#> One block
33+
#> Two block
34+
35+
# @hello world
36+
#> Red block
37+
# @hello world
38+
#> Blue block
39+
# @hello world
40+
41+
#> An indented block
42+
# @hello does this still work?
43+
# hopefully it does
44+
execute as @s run say goodbye world
45+
46+
#> Yet another block
47+
# @except this time
48+
# we have very strange indents
49+
execute as @s run say goodbye world
50+
execute as @s run say goodbye world
51+
execute as @s run say goodbye world
52+
53+
#> Yet another block
54+
# @yeah another one
55+
# blah blah blah
56+
execute as @s run say this should also be a command
57+
execute as @s run say this should also also be a command
58+
59+
execute as @s run say this should also also also be a command
60+
61+
## An alternate block comment prefix
62+
# a
63+
# b
64+
# c
65+
66+
### With multiple characters
67+
68+
########## Really long one
69+
70+
#~ Another alternate prefix
71+
72+
#! And another one
73+
74+
#@ And another one
75+
76+
#$ And another one
77+
78+
#% And another one
79+
80+
#^ And another one
81+
82+
#* And another one

0 commit comments

Comments
 (0)