A test would be a waste of your time and money. Hypothetically speaking, even if you were poked by a needle or a sharp object, there can be no risk associated for HIV transmission.
This virus is fragile and it is rendered uninfectious no sooner than it is exposed to the environment.
Even for an occupational hollow-bore needle injury, the odds of transmission is calculated at 0.2%, practically, it can be considered as no-risk situation.
You seem to be misinterpreting the information that you must have come across on the internet, those news are mainly due to someone being injected with infected body fluid intravenously, which offcourse, is not equivalent to being pricked with a needle.
I agree with my fellow posters, it is observed here on this forum, people who suspect such events usually suffer from anxiety disorder. It is advisable to see a therapist to seek help, we suggest that compassionately as we firmly believe that no one deserves to live in fear and worry of such things.
We wish you the best.
Yes, it does sound far fetched. I'm not sure that 'these things happen' is really accurate. Imagining these things happening is common for those who have anxiety leading to irrational fear. We aren't here to say that like it is a put down. I personally feel bad that you have anxiety to this level. Anxiety is a treatable disorder as long as you recognize you need help with it.
Your scenario is just not realistic.
And the way people get HIV is from unprotected vaginal or anal sex or sharing IV drug needles. A needle poke does not transmit HIV because the needle is exposed to air. Injecting drugs is different than a poke.
I really urge you to get help for the mental health aspect. Fearing a hug, fearing needles, having catastrophic thinking from simple life's events is not something you should willingly do by not working with a health care professional to overcome it as best you can.
The only people who ask these types of questions about being poked with needles by random strangers are those who suffers from irrational health anxiety and HIV phobia.
People don't go around poking random strangers with needles in public places. It literally does not happen. You were not poked with a needle. Your irrational thoughts are lying to you and causing unnecessary ruminating about a non issue.
I strongly advise you to seek out a therapist with whom to address this issue. This is the only way you will be able to overcome your irrationally thinking.