Skip to content

Commit

Permalink
Added test for the effect of tapeworm on calories
Browse files Browse the repository at this point in the history
  • Loading branch information
jbytheway committed Dec 7, 2019
1 parent a5cc966 commit 1837243
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/stomach_contents_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,25 @@ TEST_CASE( "all_nutrition_starve_test" )
CHECK( dummy.vitamin_get( vitamin_id( "calcium" ) ) >= -100 );
}

TEST_CASE( "tape_worm_halves_nutrients" )
{
const efftype_id effect_tapeworm( "tapeworm" );
const bool print_tests = false;
player &dummy = g->u;
reset_time();
clear_stomach( dummy );
eat_all_nutrients( dummy );
print_stomach_contents( dummy, print_tests );
int regular_kcal = dummy.stomach.get_calories();
clear_stomach( dummy );
dummy.add_effect( effect_tapeworm, 1_days );
eat_all_nutrients( dummy );
print_stomach_contents( dummy, print_tests );
int tapeworm_kcal = dummy.stomach.get_calories();

CHECK( tapeworm_kcal == regular_kcal / 2 );
}

// reasonable length of time to pass before hunger sets in
TEST_CASE( "hunger" )
{
Expand Down

0 comments on commit 1837243

Please sign in to comment.