Add a holes assertion. But also serves as an example on how to create custom assertions to operate on specific objects. Hence I kept the code in a single example file, and didn't combine it with other files.
example usage;
local arr = { "one", "two", "three" }
assert.array(arr).has.no.holes() -- checks the array to not contain holes --> passes
assert.array(arr).has.no.holes(4) -- sets explicit length to 4 --> fails
local first_hole = assert.array(arr).has.holes(4) -- check array of size 4 to contain holes --> passes
assert.equal(4, first_hole) -- passes, as the index of the first hole is returned
closes #131 and #139
Add a
holes
assertion. But also serves as an example on how to create custom assertions to operate on specific objects. Hence I kept the code in a single example file, and didn't combine it with other files.example usage;