Hello there!
Based on my understanding of this question listed above, we will consider a way that we can test the pre sense of food sugar (safely).
We could do this by perhaps just looking at this kind if food and just examining it.
Another thing that we could do to test foods with the amount of stage laid in this is to even grab a utencil perhaps and to open it and to see the amount of moisture that could actually be grease.
Those are some ways that you could tell (very safely) on how to test a food with the presence of sugar and still be safe.
I hope this helps you!