Casimir energies of two-dimensional conformal field theories: A stringent test of variational ground states