Just had the very same problem and spent far too long trying to solve it. If you write test like this: $test$ then splunk interprets this as expecting an input variable of test. To resolve this it looks like you have to use double dollar signs:
| makeresults count=1 | eval test="Hello" | map search="| makeresults count=1 | eval test=$$test$$"
... View more