This repository has been archived by the owner on Jul 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
dMaterial test.dscript
101 lines (87 loc) · 3.42 KB
/
dMaterial test.dscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
dMaterial Unit Test:
type: world
debug: false
speed: 0
## Include this exact statement for each unit test
events:
on server start:
- if <server.flag[unit_tasks].as_list> !contains <script>
flag server unit_tasks:->:<script>
script:
## Do this for each unit test
- define output "s@Unit Test Write Output"
- run 's@Unit Test Create Output' 'd:<script.name>'
## Test dataVariety materials (custom dMaterials)
- run "s@Unit Test Set Prefix" 'def:data varieties'
# Red wool is red wool.
- if <m@red_wool.name> == red_wool
run %output% 'def:name|Pass'
else run %output% 'def:name|Fail'
# Red wool is made out of wool..
- if <m@red_wool.is_made_of[m@wool]> == true
run %output% 'def:is_made_of|Pass'
else run %output% 'def:is_made_of|Fail'
# ..but not made out of wood..
- if <m@red_wool.is_made_of[m@wood]> != true
run %output% 'def:is_made_of_2|Pass'
else run %output% 'def:is_made_of_2|Fail'
# Datas are ignored when not a DataVariety dMaterial..
- if <m@brewing_stand,1.is_made_of[m@brewing_stand]> == true
run %output% 'def:is_made_of_4|Pass'
else run %output% 'def:is_made_of_4|Fail'
# ..as seen here..
- if <m@brewing_stand,1.is_made_of[m@brewing_stand,2]> == true
run %output% 'def:is_made_of_5|Pass'
else run %output% 'def:is_made_of_5|Fail'
# ..but you can check datas manually!
- if <m@brewing_stand,1.data> != <m@brewing_stand,2.data>
run %output% 'def:datas|Pass'
else run %output% 'def:datas|Fail'
## Test technical tags
- run "s@Unit Test Set Prefix" 'def:technical tags'
# Check technical tags against known constants
- if <m@diamond_sword.max_stack_size> == 1
run %output% 'def:max_stack_size|Pass'
else run %output% 'def:max_stack_size|Fail'
- if <m@diamond_sword.max_durability> > 1
run %output% 'def:max_durability|Pass'
else run %output% 'def:max_durability|Fail'
- if <m@red_clay.data> == 14
run %output% 'def:data|Pass'
else run %output% 'def:data|Fail'
- if <m@stone_sword.item> == 'i@stone_sword'
run %output% 'def:item|Pass'
else run %output% 'def:item|Fail'
- if <m@birch_sapling.bukkit_enum> == 'sapling'
run %output% 'def:bukkit_enum|Pass'
else run %output% 'def:bukkit_enum|Fail'
- if <m@stone.id> == 1
run %output% 'def:id|Pass'
else run %output% 'def:id|Fail'
## Test property tags
- run "s@Unit Test Set Prefix" 'def:properties'
# Check property tags against known properties
- if <m@sand.has_gravity> == true
run %output% 'def:has_gravity|Pass'
else run %output% 'def:has_gravity|Fail'
- if <m@glass.is_block> == true
run %output% 'def:is_block|Pass'
else run %output% 'def:is_block|Fail'
- if <m@log.is_burnable> == true
run %output% 'def:is_burnable|Pass'
else run %output% 'def:is_burnable|Fail'
- if <m@bread.is_edible> == true
run %output% 'def:is_edible|Pass'
else run %output% 'def:is_edible|Fail'
- if <m@wood.is_flammable> == true
run %output% 'def:is_flammable|Pass'
else run %output% 'def:is_flammable|Fail'
- if <m@record_8.is_record> == true
run %output% 'def:is_record|Pass'
else run %output% 'def:is_record|Fail'
- if <m@cobblestone.is_solid> == true
run %output% 'def:is_solid|Pass'
else run %output% 'def:is_solid|Fail'
- if <m@sunflower.is_transparent> == true
run %output% 'def:is_transparent|Pass'
else run %output% 'def:is_transparent|Fail'