From b578f30201a3220d65b16593fe43ad5a5ebe0d64 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Tue, 2 Jan 2024 15:40:34 +0100 Subject: prog: make invalid union field error more explicit Include the name of the union and list the correct options. --- prog/encoding_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'prog/encoding_test.go') diff --git a/prog/encoding_test.go b/prog/encoding_test.go index e2abacee1..dd0dd8bfe 100644 --- a/prog/encoding_test.go +++ b/prog/encoding_test.go @@ -226,12 +226,12 @@ func TestDeserialize(t *testing.T) { { In: `test$type_confusion1(&(0x7f0000000000)=@unknown)`, Out: `test$type_confusion1(&(0x7f0000000000))`, - StrictErr: "wrong union option", + StrictErr: `wrong option "unknown" of union "type_confusion", available options are: "f1"`, }, { In: `test$type_confusion1(&(0x7f0000000000)=@unknown={0x0, 'abc'}, 0x0)`, Out: `test$type_confusion1(&(0x7f0000000000))`, - StrictErr: "wrong union option", + StrictErr: `wrong option "unknown" of union "type_confusion", available options are: "f1"`, }, { In: `test$excessive_fields1(&(0x7f0000000000)=0x0)`, -- cgit mrf-deployment