Psalms 7:9

ASV(i) 9 Oh let the wickedness of the wicked come to an end, but establish thou the righteous:
For the righteous God trieth the minds and hearts.