Skip to content

Commit

Permalink
style: renamed more variables to snake case
Browse files Browse the repository at this point in the history
  • Loading branch information
goldenstein64 committed Feb 13, 2024
1 parent b3f521c commit f788b00
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/bustez/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ local bustez = {
expect = require("bustez.expect"),
}

local bustezMt = {}
local bustez_mt = {}

function bustezMt:__call()
function bustez_mt:__call()
self.register()
return self.expect
end

setmetatable(bustez, bustezMt)
setmetatable(bustez, bustez_mt)

return bustez
22 changes: 11 additions & 11 deletions src/luassert/bustez/expect.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,26 @@ end
local function apply_arg_map(mapping, ...)
local args = util.pack(...)

local newArgs = { n = 0 }
local new_args = { n = 0 }
for i = 1, #mapping - 1 do
local index = mapping[i]
util.tinsert(newArgs, args[index])
util.tinsert(new_args, args[index])
end

local last_index = mapping[#mapping]
for index = last_index, args.n do
util.tinsert(newArgs, args[index])
util.tinsert(new_args, args[index])
end

local n = #mapping + args.n - last_index
return util.unpack(newArgs, 1, n)
return util.unpack(new_args, 1, n)
end

local arg_map
do
local default = { 1 }
local swapped = { 2, 1, 3 }
local noValue = { 2 }
local no_value = { 2 }

arg_map = {
same = swapped,
Expand All @@ -64,12 +64,12 @@ do
equals = swapped,
equal = swapped,

holes = noValue,
called = noValue,
called_with = noValue,
returned_with = noValue,
called_at_least = noValue,
called_at_most = noValue,
holes = no_value,
called = no_value,
called_with = no_value,
returned_with = no_value,
called_at_least = no_value,
called_at_most = no_value,
}

setmetatable(arg_map, {
Expand Down

0 comments on commit f788b00

Please sign in to comment.