sort directive with tests