Skip to content

Commit c36e2b1

Browse files
authored
Fix style checking action not checking .spec (#14)
1 parent dd60c56 commit c36e2b1

File tree

5 files changed

+17
-19
lines changed

5 files changed

+17
-19
lines changed

.github/workflows/code_checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
with:
1616
version: 0.18.2
1717
token: ${{ secrets.GITHUB_TOKEN }}
18-
args: --check .
18+
args: --check .spec src
1919

2020
lint:
2121
runs-on: ubuntu-latest

.spec/math/complex_spec.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ describe("Complex number", function()
4343
end
4444
for _ = 1, 1e3 do
4545
local z = complex.new(math.random(-100, 100), math.random(-100, 100))
46-
local perfect_square = z^2
47-
assert_equals_ignore_sign(perfect_square, (perfect_square^.5)^2)
48-
assert_equals_ignore_sign(perfect_square, (perfect_square:sqrt())^2)
46+
local perfect_square = z ^ 2
47+
assert_equals_ignore_sign(perfect_square, (perfect_square ^ 0.5) ^ 2)
48+
assert_equals_ignore_sign(perfect_square, (perfect_square:sqrt()) ^ 2)
4949
end
5050
end)
5151
it("conjugation works", function()

.spec/math/intpow_spec.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ describe("Integer exponentiation", function()
33
it("should work for small numbers & exponents", function()
44
for n = -1000, 1000 do
55
for exp = -2, 5 do
6-
assert.equal(n^exp, intpow(n, exp))
6+
assert.equal(n ^ exp, intpow(n, exp))
77
end
88
end
99
end)
1010
it("should work for large exponents", function()
1111
-- Powers of two don't suffer from float precision issues
1212
for i = 1, 100 do
13-
assert.equal(2^i * intpow(2, -i), 1)
14-
assert.equal(2^-i * intpow(2, i), 1)
13+
assert.equal(2 ^ i * intpow(2, -i), 1)
14+
assert.equal(2 ^ -i * intpow(2, i), 1)
1515
end
1616
end)
1717
end)

.spec/math/simplist_radical_form_spec.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
describe("Simplist radical form", function()
22
local srf = require("math.simplist_radical_form")
33
local function test_srf(x, expected_coeff, expected_root_term)
4-
assert.same({expected_coeff, expected_root_term}, {srf(x)})
4+
assert.same({ expected_coeff, expected_root_term }, { srf(x) })
55
end
66
it("handles edge cases properly", function()
77
test_srf(0, 1, 0)
88
test_srf(1, 1, 1)
99
end)
1010
it("works for square numbers", function()
1111
for n = 1, 1e3 do
12-
test_srf(n*n, n, 1)
12+
test_srf(n * n, n, 1)
1313
end
1414
end)
1515
it("works for products of primes ppq", function()
16-
local primes = {1, 3, 7, 11, 1013, 4903, 7919}
16+
local primes = { 1, 3, 7, 11, 1013, 4903, 7919 }
1717
for _, p in ipairs(primes) do
1818
for _, q in ipairs(primes) do
19-
test_srf(p*p*q, p, q)
19+
test_srf(p * p * q, p, q)
2020
end
2121
end
2222
end)

.spec/misc/coin_change_spec.lua

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
local coin_change = require("misc.coin_change")
22
describe("Coin change", function()
33
it("should find a set of coins with minimal count and correct sum", function()
4-
for value, count in
5-
pairs({
6-
[13] = 3,
7-
[33] = 4,
8-
[42] = 3,
9-
[50] = 1,
10-
})
11-
do
4+
for value, count in pairs({
5+
[13] = 3,
6+
[33] = 4,
7+
[42] = 3,
8+
[50] = 1,
9+
}) do
1210
local coin_values = coin_change(value, { 1, 2, 5, 10, 20, 50 })
1311
assert(count, #coin_values)
1412
local sum = 0

0 commit comments

Comments
 (0)