Test print() on objects with toString method