(Lo! We tested those who were before you) before the Companions of Muhammad (pbuh) after the demise of their prophets, with caprice, blameworthy innovations and the violation of sanctities. (Thus Allah knoweth) in order that Allah sees and distinguishes (those who are sincere) in their faith by avoiding caprice, blameworthy innovation and by shunning that which is unlawful, (and knoweth those who feign) i.e. the insincere in their faith who follow caprice, blameworthy innovation and the violation of sanctities.