  We study the problem of testing unateness of functions $f:\{0,1\}^d \to
\mathbb{R}.$ We give a $O(\frac{d}{\epsilon} \cdot
\log\frac{d}{\epsilon})$-query nonadaptive tester and a
$O(\frac{d}{\epsilon})$-query adaptive tester and show that both testers are
optimal for a fixed distance parameter $\epsilon$. Previously known unateness
testers worked only for Boolean functions, and their query complexity had worse
dependence on the dimension both for the adaptive and the nonadaptive case.
Moreover, no lower bounds for testing unateness were known. We also generalize
our results to obtain optimal unateness testers for functions $f:[n]^d \to
\mathbb{R}$.
  Our results establish that adaptivity helps with testing unateness of
real-valued functions on domains of the form $\{0,1\}^d$ and, more generally,
$[n]^d$. This stands in contrast to the situation for monotonicity testing
where there is no adaptivity gap for functions $f:[n]^d \to \mathbb{R}$.
