Passing tests is not useless. It shows knowledge at the level of the test.
I write tests for my code and when they fail I know I have to change something. If you're finishing a math test and not passing, then you don't have the skills to solve the problems in said test.
Tests are only useless when you ace them.
Beyond that, there’s research[0] showing that testing humans actually increases their retention on that subject — we don’t just gives tests to kids to evaluate whether they successfully learned something.
[0] https://gwern.net/doc/psychology/spaced-repetition/2006-roed...