Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:29:3

But We have certainly tried those before them, and Allah will surely make evident those who are truthful, and He will surely make evident the liars.  

And certainly We tried those who were before them. So God shall surely know those who are sincere, in their faith — a knowledge of direct vision — and He shall surely know those who are liars, regarding it.
القرآن:٢٩:٣

وَلَقَدْ فَتَنَّا الَّذِينَ مِنْ قَبْلِهِمْ ۖ فَلَيَعْلَمَنَّ اللَّهُ الَّذِينَ صَدَقُوا وَلَيَعْلَمَنَّ الْكَاذِبِينَ  

{ولقد فتنَّا الذين من قبلهم فليعلمن الله الذين صدقوا} في إيمانهم علم مشاهدة {وليعلمنَّ الكاذبين} فيه.

See similar narrations below:

Collected by Suyūṭī
suyuti:4-1368bʿAlī
Request/Fix translation

  

السيوطي:٤-١٣٦٨b

"عنْ عَلِيٍّ أَنَّهُ كانَ يقْرأُ: {فَلَيَعْلَمَنَّ اللَّهُ الَّذِينَ صَدَقُوا وَلَيَعْلَمَنَّ الْكَاذِبِينَ} قَالَ: يُعْلِمُهُمُ النَّاس".  

ابن أبى حاتم