Adding test for encoder and decoder.