Two distinct forms are flat edged, or knife edged.
Straight edges are used many ways. Most center around detecting high or low spots, aligning 2 or more individual components, bridging unconnected areas to support a bubble level or run indicators, and scribing long lines, for example. A rough casting could be "trammed" dependably with a straight edge, properly supported; IF the mounting surface [surface plate, mill, grinder...] is also level.
Flat edged commonly are wide enough to support themselves upright, sufficient width for rigidity. A reliable test would park the edge on equal thickness feeler stock at Airy/ Bessel points {
https://www.engineeringnotes.org/metrology/airy-points-and-bessel-points/ }. A third feeler of equal or increment thinner/ thicker size would detect corresponding high or low spots.
Knife-edges are usually hand held in direct contact with clean surface in question, toward illumination that highlights discrepancies, including poor surface finish. A typical test includes along length, width and across corners.
A cylindrical square is very similar, by nature of the shape making minimal linear contact.