Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
reintroduce tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rush42 committed Jul 2, 2024
1 parent 84aa5d0 commit 66a1b8f
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
describe("AdjoiningOrIsolatedWrapper", function()
package.path = package.path .. ";/processing/topics/roads_bikelanes/bikelanes/categories/?.lua"
require("BikelaneCategories")
require("AdjoiningOrIsolatedWrapper")

local testCategory = BikelaneCategory.new({name = "test", condition= function () return true end })
local testCategoryAdjoining, testCategoryIsolated, testCategoryAdjoiningOrIsolated = AdjoiningOrIsolatedWrapper(testCategory)
it('should add postfix "adjoining" when IsSidepath is true', function()
local tags = { ["is_sidepath"] = "yes" }
local result = AddAdjoiningOrIsolated("foo", tags)
assert.are.same(result, "foo_adjoining")
end)

it('should add postfix isolated when is_sidepath is no', function()
local tags = { ["is_sidepath"] = "no" }
local result = AddAdjoiningOrIsolated("foo", tags)
assert.are.same(result, "foo_isolated")
end)

it('should add postfix adjoiningOrIsolated when is_sidepath is not defined', function()
local tags = {}
local result = AddAdjoiningOrIsolated("foo", tags)
assert.are.same(result, "foo_adjoiningOrIsolated")
end)
end)

0 comments on commit 66a1b8f

Please sign in to comment.