What exactly is reset_robot (in robot-name) supposed to do?

This is the only test for reset_robot:

test_that("Can reset the name", {
  robot <- new_robot()
  reset_robot <- reset_robot(robot)
  expect_true(robot$name != reset_robot$name)
})

It seems to create a new robot. Whether the original robot’s name gets changed doesn’t seem to be tested for, only that it is different from the name of the new robot. I would think a test for reset_robot as described in instructions would be something like:

test_that("Can reset the name", {
  robot <- new_robot()
  orig_name <- robot$name
  reset_robot(robot)
  expect_true(robot$name != orig_name)
})

Hi!
All misunderstanding probably comes from the fact that in R passing argument to function is done by copy.
So robot inside reset_robot function points to different object than outside (despite the same name).
Then the copied robot is returned and assigned to reset_robot variable.

Thanks to that we can compare robot names before and after the reset.

Of course in regular code we would like to have original robot’s name to be changed. We achieve it by reassigning the original robot variable to the new robot:
robot <- reset_robot(robot)