Terahertz quantum-cascade lasers for high-resolution spectroscopy of sharp absorption lines