func TestDecodeErrors(t *testing.T) { for _, test := range decodeTests { _, err := lich.Decode(test.input) if (err != nil) != test.err { t.Errorf("Decode(%v).err = %v", test.input, err) } } }
func TestDecodeRoundTrip(t *testing.T) { for _, test := range decodeTests { if test.err { continue } el, err := lich.Decode(test.input) if err != nil { t.Errorf("Decode(%v).err = %v", test.input, err) } if el == nil { t.Errorf("Decode(%v) = %v", test.input, el) } if el.String() != test.input { t.Errorf("Decode(%v) = %v", test.input, el) } } }