<commit_before>local expand_rockspec = require "luacheck.expand_rockspec"

describe("expand_rockspec", function()
   it("returns sorted array of lua files related to a rock", function()
      assert.same({
         "bar.lua",
         "baz.lua",
         "bin.lua",
         "foo.lua"
      }, expand_rockspec("spec/folder/rockspec"))
   end)

   it("autodetects modules for rockspecs without build table", function()
      assert.same({
         "spec/rock/src/rock.lua",
         "spec/rock/src/rock/mod.lua",
         "spec/rock/bin/rock.lua"
      }, expand_rockspec("spec/rock/rock-dev-1.rockspec"))
   end)

   it("autodetects modules for rockspecs without build.modules table", function()
      assert.same({
         "spec/rock2/mod.lua"<commit_msg>Fix expand_rockspec spec for Windows<commit_after>local expand_rockspec = require "luacheck.expand_rockspec"
local fs = require "luacheck.fs"
local P = fs.normalize

describe("expand_rockspec", function()
   it("returns sorted array of lua files related to a rock", function()
      assert.same({
         "bar.lua",
         "baz.lua",
         "bin.lua",
         "foo.lua"
      }, expand_rockspec("spec/folder/rockspec"))
   end)

   it("autodetects modules for rockspecs without build table", function()
      assert.same({
         P"spec/rock/src/rock.lua",
         P"spec/rock/src/rock/mod.lua",
         P"spec/rock/bin/rock.lua"
      }, expand_rockspec("spec/rock/rock-dev-1.rockspec"))
   end)

   it("autodetects modules for rockspecs without build.modules table", function()
      assert.same({
         P"spec/rock2/mod.lua"
{'fraction_non_alphanumeric': 0.13525360050093926, 'fraction_numerical': 0.002504696305572949, 'mean_word_length': 2.8047619047619046, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6620076', 'n_tokens_mistral': 518, 'n_tokens_neox': 518, 'n_words': 106}