A few ways
The most accurate way would be placement of a tube through the nose or mouth, into the stomach, and sampling of gastric juices for acidity.
A blood test for gastrin
( a hormone
which causes acid secretion) can also be helpful. Testing for "low acid" is not generally done except in the evaluation of uncommon diseases.