The original code struck me as odd, shouldn’t it be sum = set[1] or 0? Right now, it’s discarding the first element, and counts the second twice towards the sum.
The code was modified to set[2] on 2022-04-24 in 85686ae58eb07a73418e53392921663c6b35932d, before it was indeed sum = set[1].
Tests?
There are tests in tests/test_math.lua, but they’re asserting wrong things,
I’m not on a computer with a Lua dev env at the moment, so unfortunately I can’t run the tests. I’d be open to adding CI support to the repo if it’s something you’d like o:-)
Description
The original code struck me as odd, shouldn’t it be
sum = set[1] or 0
? Right now, it’s discarding the first element, and counts the second twice towards the sum.The code was modified to
set[2]
on 2022-04-24 in 85686ae58eb07a73418e53392921663c6b35932d, before it was indeedsum = set[1]
.Tests?
There are tests in
tests/test_math.lua
, but they’re asserting wrong things,CI?
I’m not on a computer with a Lua dev env at the moment, so unfortunately I can’t run the tests. I’d be open to adding CI support to the repo if it’s something you’d like o:-)