Address final review nits on the assertions

- Suite.empty(value, name) checks a table has no entries and reports what it
  held, and Suite.throws(fn, message, name) asserts a function errors with the
  given message, so an unrelated error no longer passes as the expected one.
- Scalar comparisons and zero length checks go through eq and empty, and the
  announced messages and print output are compared by content, so a failure
  shows the actual data.
- get_roles() is asserted through sorted names rather than a count.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
bbassie
2026-08-26 10:48:43 +00:00
co-authored by Claude Fable 5
parent 3218351db6
commit 574a0a4b52
6 changed files with 73 additions and 35 deletions
+3 -1
View File
@@ -43,7 +43,9 @@ test("get_player_highest_role() errors when a player has no roles", function(env
env.Roles.receive_role_updates{
{ id = env.R("Player").id, name = "Player", permissions = {}, meta = { id = 0, order = 5 }, is_deleted = true },
}
check(not pcall(env.Roles.get_player_highest_role, players.carol), "no default role and no held roles errors")
Suite.throws(function()
env.Roles.get_player_highest_role(players.carol)
end, "Player has no roles", "no default role and no held roles errors")
end)
test("player_has_permission()", function(env)