$upper() will transform text to uppercase. It's not meant as a way to detect uppercase text.

For example:

//echo -a $upper(soMe tEXt) - This will result in "SOME TEXT"