table-driven test for encoder