aboutsummaryrefslogtreecommitdiff
path: root/games/devtest/screenshot.png
blob: 7324883f6c29aafd8e50f3eac6c8515c8e39b866 (plain)
blob size (130KB) exceeds display size limit (100KB).
d=5440de17859127bee4c0c9023c0e28570555d36f'>plain)
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
100
101
102
103
104
105
106
107
108
109
110
111
112
dofile(core.get_modpath(core.get_current_modname()) .. "/crafting_prepare.lua")

-- Test minetest.clear_craft function
local function test_clear_craft()
	-- Clearing by output
	minetest.register_craft({
		output = "foo",
		recipe = {{"bar"}}
	})
	minetest.register_craft({
		output = "foo 4",
		recipe = {{"foo", "bar"}}
	})
	assert(#minetest.get_all_craft_recipes("foo") == 2)
	minetest.clear_craft({output="foo"})
	assert(minetest.get_all_craft_recipes("foo") == nil)
	-- Clearing by input
	minetest.register_craft({
		output = "foo 4",
		recipe = {{"foo", "bar"}}
	})
	assert(#minetest.get_all_craft_recipes("foo") == 1)
	minetest.clear_craft({recipe={{"foo", "bar"}}})
	assert(minetest.get_all_craft_recipes("foo") == nil)
end
unittests.register("test_clear_craft", test_clear_craft)

-- Test minetest.get_craft_result function
local function test_get_craft_result()
	-- normal
	local input = {
		method = "normal",
		width = 2,
		items = {"", "unittests:coal_lump", "", "unittests:stick"}
	}