Skip to content

Commit

Permalink
Fix som format and property access issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinHelmut committed Aug 1, 2024
1 parent 486ea3d commit c352b7b
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 38 deletions.
2 changes: 1 addition & 1 deletion src/examples/factorial-test-2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local tr = require("examples/test-runner")
local factorial = require("examples/factorial")

tr:test(function ()
assert( factorial(1) == 1, "Factor of 1 should be 1")
assert(factorial(1) == 1, "Factor of 1 should be 1")
end)

tr:test(function ()
Expand Down
6 changes: 3 additions & 3 deletions src/examples/factorial-test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ local factorial = require("examples/factorial")

local TestFactorial = {}

function TestFactorial:test1()
function TestFactorial.test1()
lu.assertEquals(factorial(0), 1)
end

function TestFactorial:test2()
function TestFactorial.test2()
lu.assertEquals(factorial(1), 1)
end

function TestFactorial:test3()
function TestFactorial.test3()
lu.assertEquals(factorial(4), 24)
end

Expand Down
2 changes: 1 addition & 1 deletion src/examples/logger-test.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local lu = require("luaunit")
require("luaunit")
local Logger = require("examples/logger")

local TestLogger = {}
Expand Down
4 changes: 2 additions & 2 deletions src/examples/logger.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- Example code for setUp and tearDown usage.
local Logger = {}

function Logger:setup() end
function Logger.setup() end

function Logger:log() end
function Logger.log() end

return Logger
2 changes: 1 addition & 1 deletion src/examples/mock-exported-test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function TestSomeModule:setUp()
someModule.fn = function () return true end
end

function TestSomeModule:test1()
function TestSomeModule.test1()
lu.assertTrue(someModule.fn())
end

Expand Down
2 changes: 1 addition & 1 deletion src/examples/mock-global-test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function TestGlobal:setUp()
self.backupPrint = _G.print
end

function TestGlobal:test1()
function TestGlobal.test1()
local hasBeenCalled = false
_G.print = function () hasBeenCalled = true end
log("Hello World")
Expand Down
2 changes: 1 addition & 1 deletion src/examples/mock-module/assets-test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function TestAssets:setUp()
end
end

function TestAssets:test1()
function TestAssets.test1()
local assets = require("examples/mock-module/assets")
lu.assertEquals(assets.getPath(), "/assets")
end
Expand Down
2 changes: 1 addition & 1 deletion src/examples/mock-module/assets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local path = require("path")

local Assets = {}

function Assets:getPath()
function Assets.getPath()
local userHome = path.user_home()
return userHome .. path.DIR_SEP .. "assets"
end
Expand Down
4 changes: 2 additions & 2 deletions src/examples/round-test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ local round = require("examples/round")

local TestRound = {}

function TestRound:test1()
function TestRound.test1()
lu.assertEquals(round(3.44), 3)
end

function TestRound:test2()
function TestRound.test2()
lu.assertEquals(round(3.44, 1), 3.4)
end

Expand Down
25 changes: 0 additions & 25 deletions src/examples/tracer-example.lua

This file was deleted.

0 comments on commit c352b7b

Please sign in to comment.