Add tests ensuring correct escaping of ANSI chars on line refresh