How and where do you test if it is exported? I guess not in the same script. As Franklin already wrote, you have to source the exporting script to have set variables etc. available in your current shell or script.
Just executing the script and after that hoping to have the variable available in the current shell will not work.
The export only works in subsequent shells being called by the shell that exported the variable. It can't be exported that way to a same or higher level shell, if you imagine the calling of shells like a kind of tree construct.
Perhaps re-read post #3, an additon to the minor correction to the script posted.
How you execute the script is important if you want to set environment variables in the current environment.
That is dot-space-dot-solidus-scriptname.
If such a script exports environment variables those environment variables are available to slave scripts run directly from the current shell. You can never export to a parent script.