Skip to content

Commit

Permalink
small cleanup and expand test coverage of living/status
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelprograms committed Feb 9, 2025
1 parent 50b329b commit c85a804
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 1 addition & 5 deletions lib/std/living/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ int query_immobile () {
}

void set_posture (string p) {
if (
!stringp(p) &&
!sizeof(p) &&
member_array(p, ({ "flying", "laying", "meditating", "sitting", "standing" })) == -1
) {
if (member_array(p, ({ "flying", "laying", "meditating", "sitting", "standing" })) == -1) {
error("Bad argument 1 to status->set_posture");
}
__Posture = p;
Expand Down
2 changes: 2 additions & 0 deletions lib/std/living/status.test.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ void test_posture () {
assert_equal(testOb->query_posture(), "laying"),
testOb->set_posture("standing"),
assert_equal(testOb->query_posture(), "standing"),

assert_catch((: testOb->set_posture("unknown") :), "*Bad argument 1 to status->set_posture\n"),
}) :));

// @TODO
Expand Down

0 comments on commit c85a804

Please sign in to comment.