1 Thessalonians 2:3-4 (ESV):
3 For our appeal does not spring from error or impurity or any attempt to deceive, 4 but just as we have been approved by God to be entrusted with the gospel, so we speak, not to please man, but to please God who tests our hearts.
What is the purpose of God's testing of our hearts if He has perfect foreknowledge of our actions? There are even those who claim that He has perfect foreknowledge of our counterfactual actions as well (a.k.a. middle knowledge). Is God gaining any kind of new information about us by testing us? How can we make sense of His testing?