for overload resolution purposes the functions
Test& operator=(Test other);
Test& operator=(Test&& other);
are equal, because the implicit conversion sequences used to convert to Test and Test&&, respectively, are equal. The former is not better, because the direct reference binding is also considered an identity conversion.
When confronted with the ambiguity of 2 equally good matches, the compiler gives an error. You probably want this:
#ifdef COPY_AND_SWAP
Test& operator=(Test other);
#else
Test& operator=(const Test& other);
Test& operator=(Test&& other);
#endif