Add unit tests with explicit line numbers for lib/dg.exp