@cjd Part of the confusion is that there are two different words translated "knowledge" in KJV. The tree is named daath in 2:17, https://biblehub.com/hebrew/1847.htm while the serpent promises yada in 3:5, https://biblehub.com/hebrew/3045.htm
The KJV translates daath as "premeditated" in Joshua 20:3,5. The most common context for yada is e.g. 4:1, "and Adam knew his wife".
daath is choosing for yourself. E.g. Exodus 31:3 describes a needed quality of an artist for the tabernacle: able to make his own design choices.
yada is knowing by direct intimate experience. In Genesis 15:8, Abram wants some tangible evidence or token of God's promise.
So - the tree is indeed a test. Satan subtly alters what God actually said. Many think Adam may have exaggerated the prohibition with "neither shall you touch it".