mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-09-22 17:24:01 +00:00
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:
co-authored by
Claude Fable 5
parent
3218351db6
commit
574a0a4b52
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user