Skip to content

Commit

Permalink
Fix bugs and formating.
Browse files Browse the repository at this point in the history
  • Loading branch information
sfence committed Dec 28, 2023
1 parent 752caca commit d6f6479
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions games/devtest/mods/unittests/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ unittests.register("test_player_meta", run_player_meta_tests, {player=true})
--
-- Player add pos
--
local function run_player_add_pos(player)
local pos = player:get_pos();
local function run_player_add_pos_tests(player)
local pos = player:get_pos()
player:add_pos(vector.new(0,1000,0))
local newpos = player:get_pos();
local newpos = player:get_pos()
player:add_pos(vector.new(0,-1000,0))
local backpos = player:get_pos();
local backpos = player:get_pos()
local newdist = vector.distance(pos, newpos)
assert( (newdist>995) and (newdist<1001) )
assert(math.abs(newdist-1000)<=1)
assert(vector.distance(pos, backpos)<=1)
end
unittests.register("test_player_meta", run_player_add_pos, {player=true})
unittests.register("test_player_add_pos", run_player_add_pos_tests, {player=true})

0 comments on commit d6f6479

Please sign in to comment.