prog: test that Deserialize does not return nil prog

That happened when parser did not check scanning errors and
a program contains too long line.
This commit is contained in:
Dmitry Vyukov 2017-01-05 12:41:25 +01:00
parent 4ca49b389a
commit b5aa8b4506

View File

@ -37,6 +37,9 @@ func TestSerialize(t *testing.T) {
if err != nil {
t.Fatalf("failed to deserialize program: %v\n%s", err, data)
}
if p1 == nil {
t.Fatalf("deserialized nil program:\n%s", data)
}
data1 := p1.Serialize()
if len(p.Calls) != len(p1.Calls) {
t.Fatalf("different number of calls")