Commit Graph

199 Commits

Author SHA1 Message Date
Alexis Beingessner
34936be574 test deserialize_from 2017-12-04 13:29:03 -05:00
David Tolnay
8c34e0940f
Release 1.0.23 2017-11-29 22:26:32 -08:00
David Tolnay
eb6bf16a51
Revert "Catch wrong field names length in serde_test"
There are at least two reasonable things to expect the len field to
check: the length of the fields array passed to deserialize_struct, or
the number of field tokens. Even beyond these, in some cases it can be
useful to test deserialization with a bogus len to test how the
Deserialize impl reacts to an incorrect size_hint.

This reverts commit 436cafb0a3 which was
released in serde_test 1.0.20.
2017-11-29 22:21:05 -08:00
David Tolnay
797d049db5
Release 1.0.22 2017-11-29 20:01:43 -08:00
David Tolnay
f218f4d7bf
Release 1.0.21 2017-11-15 22:24:18 -08:00
David Tolnay
4773863e3a
Release 1.0.20 2017-11-12 10:29:08 -08:00
David Tolnay
436cafb0a3
Catch wrong field names length in serde_test 2017-11-12 10:16:43 -08:00
David Tolnay
98bb02e9b4
Whitelist use of Debug in serde_test 2017-11-07 10:00:18 -08:00
David Tolnay
142439088c
Merge pull request #1086 from Marwes/better_errors
Print the contents of the expected token when a serialize assert fails
2017-11-07 09:53:58 -08:00
Markus Westerlind
ce81288235 Print the contents of the expected token when a serialize assert fails
Before
```
expected Token::Str but serialized as Str(“F9168C5E-CEB2-4FAA-B6BF-329BF39FA1E4")
```
After
```
expected Token::Str(“f9168c5e-ceb2-4faa-b6bf-329bf39fa1e4”) but serialized as Str(“F9168C5E-CEB2-4FAA-B6BF-329BF39FA1E4")
```
2017-11-07 14:22:42 +01:00
David Tolnay
88d5fe6bfd
Release 1.0.19 2017-11-06 23:50:24 -08:00
David Tolnay
9a2c352025
Rephrase serde_test::Configure documentation 2017-11-06 23:47:39 -08:00
David Tolnay
61c90cb8cb
Fix typo in serde_test::Configure documentation 2017-11-06 23:45:26 -08:00
David Tolnay
501bae42f5
Fix space in serde_test panic message
Without this, the message contains "representationsmust".
2017-11-06 22:46:28 -08:00
David Tolnay
7a0397451e
Allow serde_test::Configure to be dynamically sized
This is a more cautious choice for the trait. In the future we may need
a `whatever_ref(&self)` that works for !Sized types.
2017-11-06 22:40:09 -08:00
David Tolnay
16787318d1
Enable clippy_pedantic in serde_test 2017-11-06 22:31:35 -08:00
David Tolnay
f4ae0888c8
Run clippy on serde_test in Travis 2017-11-06 22:28:58 -08:00
David Tolnay
213071fe5c
Combine identical match arms in serde_test
As recommended by Clippy's match_same_arms lint.
2017-11-06 22:27:51 -08:00
David Tolnay
cfd26c6fda
Avoid cloning Copy types
As recommended by Clippy's clone_on_copy lint.
2017-11-06 22:26:55 -08:00
David Tolnay
23fa83941e
Whitelist float_cmp lint in serde_test 2017-11-06 22:26:01 -08:00
David Tolnay
88f5b9511d
Use .. in patterns
As recommended by Clippy's unneeded_field_pattern lint.
2017-11-06 22:24:25 -08:00
David Tolnay
f6ac232580
Merge pull request #1084 from Marwes/serde_test_readable_
Add an API for making tests for readable/compact representations
2017-11-06 22:05:29 -08:00
Markus Westerlind
aad7a7987f Add an example to the Configure trait 2017-11-06 10:35:22 +01:00
Konrad Borowski
5796f1a0f5 serde_test requires serde 1.0.16 to work
This is due to implementing is_human_readable which was
added in serde 1.0.16.
2017-11-05 23:51:01 +01:00
David Tolnay
ab68132b1f
Release 1.0.18 2017-11-03 10:20:41 -07:00
Markus Westerlind
1b9a096fa7 Export configure api 2017-11-02 16:03:50 +01:00
Markus Westerlind
39e05ffad2 Implement Deserializer for Readable/Compact 2017-11-02 15:47:07 +01:00
Markus Westerlind
78fab25c5c implement Serializer for Readable/Compact 2017-11-02 15:47:07 +01:00
David Tolnay
ad680cbd44
Release 1.0.17 2017-10-31 09:36:06 -07:00
David Tolnay
422191fcb0
Release 1.0.16 2017-10-22 11:29:44 -07:00
David Tolnay
4ed0362c8e
Panic by default in serde_test is_human_readable
The serde_test Serializer and Deserializer panic in is_human_readable unless the
readableness has been set explicitly through one of the hidden functions. This
is to force types that have distinct readable/compact representations to be
tested explicitly in one or the other, rather than with a plain assert_tokens
which arbitrarily picks one.

We need to follow up by designing a better API in serde_test to expose this
publicly. For now serde_test cannot be used to test types that rely on
is_human_readable. (The hidden functions are meant for our test suite only.)
2017-10-17 09:49:42 -07:00
David Tolnay
030459a040 Merge pull request #1044 from Marwes/human_readable
Serialize to binary if the serde format is not human readable
2017-10-15 16:39:58 -07:00
Markus Westerlind
e9b530a000 Hide is_human_readable constructors in serde_test
Until a good API can be found
2017-10-13 17:37:47 +02:00
David Tolnay
ea1a729088
Release 1.0.15 2017-09-17 13:58:35 -07:00
Markus Westerlind
e36915300f Properly deserialize non-readable IpAddr and SocketAddr 2017-09-14 17:08:17 +02:00
David Tolnay
4b00de0e22
Release 1.0.14 2017-09-09 12:50:57 -07:00
David Tolnay
c3eced410f
Release 1.0.13 2017-09-09 11:40:31 -07:00
Markus Westerlind
0dccbb1f11 Serialize to binary if the serde format is not human readable
This implements the KISS suggested in https://github.com/serde-rs/serde/issues/790.
It is possible that one of the other approaches may be better but this
seemed like the simplest one to reignite som discussion.

Personally I find the original suggestion of adding two traits perhaps slightly
cleaner in theory but I think it ends up more complicated in the end
since the added traits also need to be duplicated to to the `Seed`
traits.

Closes #790
2017-09-07 16:20:57 +02:00
David Tolnay
d4042872f5
Release 1.0.12 2017-09-04 11:11:44 -07:00
David Tolnay
26098ed877
Release 1.0.11 2017-07-27 00:56:28 -07:00
David Tolnay
83537c95e1
Release 1.0.10 2017-07-11 21:19:24 -07:00
David Tolnay
9ecb0839de
Release 1.0.9 2017-06-29 20:21:29 -07:00
David Tolnay
fd3d1396d3
Release 1.0.8 2017-05-24 00:17:27 -07:00
David Tolnay
c47b4c8e0b
Release 1.0.7 2017-05-19 17:00:31 -07:00
David Tolnay
3d7aad1e7b
Release 1.0.6 2017-05-17 08:20:54 -07:00
David Tolnay
4d5e450054
Release 1.0.5 2017-05-14 12:53:48 -07:00
David Tolnay
c68b959696
Release 1.0.4 2017-05-10 20:05:22 -07:00
David Tolnay
58e30eaee4
Release 1.0.3 2017-05-10 10:15:39 -07:00
David Tolnay
8fafc7420c
Release 1.0.2 2017-04-27 12:32:30 -07:00
David Tolnay
c7901e532e
Release 1.0.1 2017-04-23 16:40:56 -07:00