  We present a new test of the validity of the
Friedmann-Lemaitre-Robertson-Walker (FLRW) metric, based on comparing the
distance from redshift 0 to $z_1$ and from $z_1$ to $z_2$ to the distance from
$0$ to $z_2$. If the universe is described by the FLRW metric, the comparison
provides a model-independent measurement of spatial curvature. The test relies
on geometrical optics, it is independent of the matter content of the universe
and the applicability of the Einstein equation on cosmological scales. We apply
the test to observations, using the Union2.1 compilation of supernova distances
and Sloan Lens ACS Survey galaxy strong lensing data. The FLRW metric is
consistent with the data, and the spatial curvature parameter is constrained to
be $-1.22<\Omega_{K0}<0.63$, or $-0.08<\Omega_{K0}<0.97$ with a prior from the
cosmic microwave background and the local Hubble constant, though modelling of
the lenses is a source of significant systematic uncertainty.
