Your description of TDD is slightly incomplete: the steps include, after writing the test, running the test when you expect it to fail. The idea being that if it doesn’t fail, you have either written an ineffective test (this is more likely than one might think) or the code under test actually already handles that case.
Then you write the code (as little code as needed) and confirm that the test passes where it didn’t before to validate that work.
Your description of TDD is slightly incomplete: the steps include, after writing the test, running the test when you expect it to fail. The idea being that if it doesn’t fail, you have either written an ineffective test (this is more likely than one might think) or the code under test actually already handles that case.
Then you write the code (as little code as needed) and confirm that the test passes where it didn’t before to validate that work.