@@ -256,13 +256,13 @@ describe("luarocks-build-lls-addon", function()
256256
257257 it (" works when there is a plugin included" , function ()
258258 setupProject (" with-plugin" )
259- assert .are_equal (" file" , mode (path (LUA_DIR , " types .lua" )))
259+ assert .are_equal (" file" , mode (path (INSTALL_DIR , " plugin .lua" )))
260260 local luarc = json .read (" .luarc.json" )
261261 assert .are_same ({
262262 runtime = {
263263 plugin = {
264264 FAKE_LOADER_SOURCE ,
265- path (LUA_DIR , " types .lua" ),
265+ path (INSTALL_DIR , " plugin .lua" ),
266266 },
267267 },
268268 }, luarc )
@@ -282,14 +282,14 @@ describe("luarocks-build-lls-addon", function()
282282 it (" works when there is a library and plugin included" , function ()
283283 setupProject (" with-lib-plugin" )
284284 assert .are_equal (" directory" , mode (path (INSTALL_DIR , " library" )))
285- assert .are_equal (" file" , mode (path (LUA_DIR , " types .lua" )))
285+ assert .are_equal (" file" , mode (path (INSTALL_DIR , " plugin .lua" )))
286286 local luarc = json .read (" .luarc.json" )
287287 assert .are_same ({
288288 workspace = { library = { path (INSTALL_DIR , " library" ) } },
289289 runtime = {
290290 plugin = {
291291 FAKE_LOADER_SOURCE ,
292- path (LUA_DIR , " types .lua" ),
292+ path (INSTALL_DIR , " plugin .lua" ),
293293 },
294294 },
295295 }, luarc )
@@ -298,14 +298,30 @@ describe("luarocks-build-lls-addon", function()
298298 it (" works when there is a config and plugin included" , function ()
299299 setupProject (" with-config-plugin" )
300300 assert .are_equal (" file" , mode (path (INSTALL_DIR , " config.json" )))
301- assert .are_equal (" file" , mode (path (LUA_DIR , " types .lua" )))
301+ assert .are_equal (" file" , mode (path (INSTALL_DIR , " plugin .lua" )))
302302 local luarc = json .read (" .luarc.json" )
303303 assert .are_same ({
304304 example = true ,
305305 runtime = {
306306 plugin = {
307307 FAKE_LOADER_SOURCE ,
308- path (LUA_DIR , " types.lua" ),
308+ path (INSTALL_DIR , " plugin.lua" ),
309+ },
310+ },
311+ }, luarc )
312+ end )
313+
314+ it (" works when there is a multi-file plugin included" , function ()
315+ setupProject (" with-multi-file-plugin" )
316+ assert .are_equal (" file" , mode (path (INSTALL_DIR , " plugin.lua" )))
317+ assert .are_equal (" directory" , mode (path (INSTALL_DIR , " plugin" )))
318+ assert .are_equal (" file" , mode (path (INSTALL_DIR , " plugin" , " submodule.lua" )))
319+ local luarc = json .read (" .luarc.json" )
320+ assert .are_same ({
321+ runtime = {
322+ plugin = {
323+ FAKE_LOADER_SOURCE ,
324+ path (INSTALL_DIR , " plugin.lua" ),
309325 },
310326 },
311327 }, luarc )
@@ -315,15 +331,15 @@ describe("luarocks-build-lls-addon", function()
315331 setupProject (" with-lib-config-plugin" )
316332 assert .are_equal (" directory" , mode (path (INSTALL_DIR , " library" )))
317333 assert .are_equal (" file" , mode (path (INSTALL_DIR , " config.json" )))
318- assert .are_equal (" file" , mode (path (LUA_DIR , " types .lua" )))
334+ assert .are_equal (" file" , mode (path (INSTALL_DIR , " plugin .lua" )))
319335 local luarc = json .read (" .luarc.json" )
320336 assert .are_same ({
321337 workspace = { library = { path (INSTALL_DIR , " library" ) } },
322338 example = true ,
323339 runtime = {
324340 plugin = {
325341 FAKE_LOADER_SOURCE ,
326- path (LUA_DIR , " types .lua" ),
342+ path (INSTALL_DIR , " plugin .lua" ),
327343 },
328344 },
329345 }, luarc )
@@ -394,15 +410,15 @@ describe("luarocks-build-lls-addon", function()
394410 local cd = lfs .currentdir ()
395411 assert .are_equal (" directory" , mode (path (INSTALL_DIR , " library" )))
396412 assert .is_nil (mode (path (INSTALL_DIR , " config.json" )))
397- assert .are_equal (" file" , mode (path (LUA_DIR , " types .lua" )))
413+ assert .are_equal (" file" , mode (path (INSTALL_DIR , " plugin .lua" )))
398414 local luarc = json .read (" .luarc.json" )
399415 assert .are_same ({
400416 hover = { enable = true },
401417 workspace = { library = { path (cd , INSTALL_DIR , " library" ) } },
402418 runtime = {
403419 plugin = {
404420 FAKE_LOADER_SOURCE ,
405- path (cd , LUA_DIR , " types .lua" ),
421+ path (cd , INSTALL_DIR , " plugin .lua" ),
406422 },
407423 },
408424 }, luarc )
0 commit comments