···334 // Valid json and message type but not an array.
335 "{\"Ok\":{\"Id\":0}}",
336 // Valid json and message type but not an array.
337- // TODO This should fail (Ok can't have an Id of 0), but currently doesn't.
338- // "[{\"Ok\":{\"Id\":0}}]",
339 // Valid json and message type but with extra content
340 "[{\"Ok\":{\"NotAField\":\"NotAValue\",\"Id\":1}}]",
341 ];
···347 .into()]);
348 for msg in incorrect_incoming_messages {
349 let res = serializer.deserialize(ButtplugSerializedMessage::Text(msg.to_owned()));
350- assert!(res.is_err());
351 if let Err(ButtplugSerializerError::MessageSpecVersionNotReceived) = res {
352 assert!(false, "Wrong error!");
353 }
···334 // Valid json and message type but not an array.
335 "{\"Ok\":{\"Id\":0}}",
336 // Valid json and message type but not an array.
337+ "[{\"Ok\":{\"Id\":0}}]",
0338 // Valid json and message type but with extra content
339 "[{\"Ok\":{\"NotAField\":\"NotAValue\",\"Id\":1}}]",
340 ];
···346 .into()]);
347 for msg in incorrect_incoming_messages {
348 let res = serializer.deserialize(ButtplugSerializedMessage::Text(msg.to_owned()));
349+ assert!(res.is_err(), "{} should be an error", msg);
350 if let Err(ButtplugSerializerError::MessageSpecVersionNotReceived) = res {
351 assert!(false, "Wrong error!");
352 }