Test on string containing spacewhile test 1 -eq 1 do read a $a if test $a = quitC then break fi d

This is the code:

while test 1 -eq 1
do
read a
$a
if test $a = stop
then
  break
fi 
done

I read a command on every loop an execute it.
I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test.
For example echo hello.
Now the script doesn't anything useful,but the idea is to count the frequency of some commands so I want to use test.
Another little issue:
How can I give "infinite" arguments to my script?

Thank you in advance.

EDIT: Ops I printed some script on the title...

Infinite loop : while true
Quote the variables and expressions
and what should do the line with the single $a ?

while true
do
read a
# $a
if test "$a" = "stop"
then
 break
fi
done

Can better be

a=""
until test "$a" = "stop" # can also be written like while "$a" != "stop"
do
read a
done