aboutsummaryrefslogtreecommitdiff
path: root/spec/quick
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2024-03-13 13:49:22 -0300
committerHisham Muhammad <hisham@gobolinux.org>2024-03-13 19:08:05 +0000
commit7cafa62d20246ea17ff1d80bb75c930e8c44feef (patch)
tree32a5392e5135d2ccf5470908159d2d4a2722b25b /spec/quick
parent870948dd2d4e208dd98ada966a109cf7156b3e4d (diff)
downloadluarocks-7cafa62d20246ea17ff1d80bb75c930e8c44feef.tar.gz
luarocks-7cafa62d20246ea17ff1d80bb75c930e8c44feef.tar.bz2
luarocks-7cafa62d20246ea17ff1d80bb75c930e8c44feef.zip
tests: replace new_version with quick tests
Diffstat (limited to 'spec/quick')
-rw-r--r--spec/quick/new_version.q213
1 files changed, 213 insertions, 0 deletions
diff --git a/spec/quick/new_version.q b/spec/quick/new_version.q
new file mode 100644
index 00000000..98426db4
--- /dev/null
+++ b/spec/quick/new_version.q
@@ -0,0 +1,213 @@
1SUITE: luarocks new_version
2
3================================================================================
4TEST: fails without a context
5
6RUN: luarocks new_version
7EXIT: 1
8
9
10
11================================================================================
12TEST: fails with invalid arg
13
14RUN: luarocks new_version i_dont_exist
15EXIT: 1
16
17
18
19================================================================================
20TEST: updates a version
21
22FILE: myexample-0.1-1.rockspec
23--------------------------------------------------------------------------------
24package = "myexample"
25version = "0.1-1"
26source = {
27 url = "git+https://localhost/myexample.git",
28 tag = "v0.1"
29}
30description = {
31 summary = "xxx",
32 detailed = "xxx"
33}
34build = {
35 type = "builtin",
36 modules = {
37 foo = "src/foo.lua"
38 }
39}
40--------------------------------------------------------------------------------
41
42RUN: luarocks new_version myexample-0.1-1.rockspec 0.2
43
44FILE_CONTENTS: myexample-0.2-1.rockspec
45--------------------------------------------------------------------------------
46package = "myexample"
47version = "0.2-1"
48source = {
49 url = "git+https://localhost/myexample.git",
50 tag = "v0.2"
51}
52description = {
53 summary = "xxx",
54 detailed = "xxx"
55}
56build = {
57 type = "builtin",
58 modules = {
59 foo = "src/foo.lua"
60 }
61}
62--------------------------------------------------------------------------------
63
64
65
66================================================================================
67TEST: updates via tag
68
69FILE: myexample-0.1-1.rockspec
70--------------------------------------------------------------------------------
71package = "myexample"
72version = "0.1-1"
73source = {
74 url = "git+https://localhost/myexample.git",
75 tag = "v0.1"
76}
77description = {
78 summary = "xxx",
79 detailed = "xxx"
80}
81build = {
82 type = "builtin",
83 modules = {
84 foo = "src/foo.lua"
85 }
86}
87--------------------------------------------------------------------------------
88
89RUN: luarocks new_version myexample-0.1-1.rockspec --tag v0.2
90
91FILE_CONTENTS: myexample-0.2-1.rockspec
92--------------------------------------------------------------------------------
93package = "myexample"
94version = "0.2-1"
95source = {
96 url = "git+https://localhost/myexample.git",
97 tag = "v0.2"
98}
99description = {
100 summary = "xxx",
101 detailed = "xxx"
102}
103build = {
104 type = "builtin",
105 modules = {
106 foo = "src/foo.lua"
107 }
108}
109--------------------------------------------------------------------------------
110
111
112
113================================================================================
114TEST: updates URL
115
116FILE: myexample-0.1-1.rockspec
117--------------------------------------------------------------------------------
118package = "myexample"
119version = "0.1-1"
120source = {
121 url = "https://localhost/myexample-0.1.tar.gz",
122}
123description = {
124 summary = "xxx",
125 detailed = "xxx"
126}
127build = {
128 type = "builtin",
129 modules = {
130 foo = "src/foo.lua"
131 }
132}
133--------------------------------------------------------------------------------
134
135RUN: luarocks new_version myexample-0.1-1.rockspec 0.2 https://localhost/newpath/myexample-0.2.tar.gz
136
137FILE_CONTENTS: myexample-0.2-1.rockspec
138--------------------------------------------------------------------------------
139package = "myexample"
140version = "0.2-1"
141source = {
142 url = "https://localhost/newpath/myexample-0.2.tar.gz"
143}
144description = {
145 summary = "xxx",
146 detailed = "xxx"
147}
148build = {
149 type = "builtin",
150 modules = {
151 foo = "src/foo.lua"
152 }
153}
154--------------------------------------------------------------------------------
155
156
157
158================================================================================
159TEST: updates MD5
160
161FILE: test-1.0-1.rockspec
162--------------------------------------------------------------------------------
163package = "test"
164version = "1.0-1"
165source = {
166 url = "file://%{url(%{fixtures_dir})}/an_upstream_tarball-0.1.tar.gz",
167 md5 = "dca2ac30ce6c27cbd8dac4dd8f447630",
168}
169build = {
170 type = "builtin",
171 modules = {
172 my_module = "src/my_module.lua"
173 },
174 install = {
175 bin = {
176 "src/my_module.lua"
177 }
178 }
179}
180--------------------------------------------------------------------------------
181
182RUN: luarocks new_version test-1.0-1.rockspec 2.0 file://%{url(%{fixtures_dir})}/busted_project-0.1.tar.gz
183
184FILE_CONTENTS: test-2.0-1.rockspec
185--------------------------------------------------------------------------------
186package = "test"
187version = "2.0-1"
188source = {
189 url = "file://%{url(%{fixtures_dir})}/busted_project-0.1.tar.gz",
190 md5 = "adfdfb8f1caa2b1f935a578fb07536eb",
191}
192build = {
193 type = "builtin",
194 modules = {
195 my_module = "src/my_module.lua"
196 },
197 install = {
198 bin = {
199 "src/my_module.lua"
200 }
201 }
202}
203--------------------------------------------------------------------------------
204
205
206
207================================================================================
208TEST: takes a URL, downloads and bumps revision by default
209
210RUN: luarocks new_version file://%{url(%{fixtures_dir})}/a_rock-1.0-1.rockspec
211
212EXISTS: a_rock-1.0-1.rockspec
213EXISTS: a_rock-1.0-2.rockspec