Skip to content

Commit

Permalink
style: added named parameters to calls
Browse files Browse the repository at this point in the history
FossilOrigin-Name: 76445b86e982fcc61f25363762680a1acad0441dfde1b750828489477626fe26
  • Loading branch information
thindil committed May 14, 2024
1 parent ae732b2 commit 2d75da0
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions tests/help.nim
Original file line number Diff line number Diff line change
Expand Up @@ -77,26 +77,23 @@ suite "Unit tests for help module":
helpType = "helptype", db = db) == QuitFailure

test "Updating a help entry":
discard deleteHelpEntry("test", db)
discard deleteHelpEntry(topic = "test", db = db)
unittest2.require:
addHelpEntry("test",
"test topic",
"test", "test help", false, db) == QuitSuccess
addHelpEntry(topic = "test", usage = "test topic", plugin = "test",
content = "test help", isTemplate = false, db = db) == QuitSuccess
checkpoint "Updating an existing help entry"
check:
updateHelpEntry("test",
"test topic",
"test", "test help2", db, false) == QuitSuccess
updateHelpEntry(topic = "test", usage = "test topic", plugin = "test",
content = "test help2", db = db, isTemplate = false) == QuitSuccess
checkpoint "Updating a non-existing help entry"
check:
updateHelpEntry("asdd",
"test topic",
"test", "test help2", db, false) == QuitFailure
updateHelpEntry(topic = "asdd", usage = "test topic", plugin = "test",
content = "test help2", db = db, isTemplate = false) == QuitFailure

test "Initializing an object of HelpEntry type":
let newHelp = newHelpEntry(topic = "test")
check:
newHelp.topic == "test"

suiteTeardown:
closeDb(QuitSuccess.ResultCode, db)
closeDb(returnCode = QuitSuccess.ResultCode, db = db)

0 comments on commit 2d75da0

Please sign in to comment.