Post-doc wants to break his promise of including me on author list
This is an unfortunate situation. If your results invalidate the post-doc's idea, then most likely they will not be included in the paper, unless one can put a positive spin on it (e.g., "an obvious explanation for the observation is Z, but here we show that Z cannot be right and instead we propose that W is the true underlying mechanism"). In this case you have no claim to authorship, despite the work you've put in. In other words, the promise of authorship was implicitly contingent on the experiments yielding positive results supporting the hypotheses advanced in the paper.

If the current manuscript is based in part on the code you wrote, then there is a case to be made that you should be an author. But I'm always of the opinion that writing some code is a weak argument for being an author, unless there is some novelty or substantial effort on your part.

Note that the post-doc said that they will consider your authorship request. You interpreted that as a no, but that seems to me an unwarranted and premature conclusion. You should have a constructive conversation with them to try to resolve the issue collegially. This kind of situations will pop up in the future, and it is a good skill to learn how to address them. Even if you get nothing out of it in the end, just remember that in the grand scheme of things it's not really a big deal and you'll forget it in (hopefully) a couple of months.