@@ -174,6 +174,57 @@ func TestParseTupleAndKeywords(t *testing.T) {
174174 results : []Object {nil },
175175 err : fmt .Errorf ("TypeError: 'func() argument 1 must be str or bytes-like, not NoneType'" ),
176176 },
177+ {
178+ args : Tuple {Bytes ("a" )},
179+ format : "y:func" ,
180+ results : []Object {Bytes ("a" )},
181+ },
182+ {
183+ args : Tuple {None },
184+ format : "y:func" ,
185+ results : []Object {nil },
186+ err : fmt .Errorf ("TypeError: 'func() argument 1 must be bytes-like, not NoneType'" ),
187+ },
188+ {
189+ args : Tuple {String ("a" )},
190+ format : "y:func" ,
191+ results : []Object {nil },
192+ err : fmt .Errorf ("TypeError: 'func() argument 1 must be bytes-like, not str'" ),
193+ },
194+ {
195+ args : Tuple {Bytes ("a" )},
196+ format : "y#:func" ,
197+ results : []Object {Bytes ("a" )},
198+ },
199+ {
200+ args : Tuple {String ("a" )},
201+ format : "y#:func" ,
202+ results : []Object {nil },
203+ err : fmt .Errorf ("TypeError: 'func() argument 1 must be bytes-like, not str'" ),
204+ },
205+ {
206+ args : Tuple {None },
207+ format : "y#:func" ,
208+ results : []Object {nil },
209+ err : fmt .Errorf ("TypeError: 'func() argument 1 must be bytes-like, not NoneType'" ),
210+ },
211+ {
212+ args : Tuple {Bytes ("a" )},
213+ format : "y*:func" ,
214+ results : []Object {Bytes ("a" )},
215+ },
216+ {
217+ args : Tuple {String ("a" )},
218+ format : "y*:func" ,
219+ results : []Object {nil },
220+ err : fmt .Errorf ("TypeError: 'func() argument 1 must be bytes-like, not str'" ),
221+ },
222+ {
223+ args : Tuple {None },
224+ format : "y*:func" ,
225+ results : []Object {nil },
226+ err : fmt .Errorf ("TypeError: 'func() argument 1 must be bytes-like, not NoneType'" ),
227+ },
177228 {
178229 args : Tuple {String ("a" )},
179230 format : "U:func" ,
0 commit comments