137 Commits

Author SHA1 Message Date
Ruifeng Xie
21523246e5
Make arbitrary_precision preserve the exact string representation 2021-07-17 11:27:27 +08:00
David Tolnay
892e2a8264
Update ui test suite to nightly-2021-05-14 2021-05-13 19:15:50 -07:00
David Tolnay
2f812d0363
Add test of RawValue deserialization from invalid utf-8 2021-02-27 20:46:09 -08:00
David Tolnay
9bcb08fd92
Fix unnecessary trailing semicolon lints in test suite
warning: unnecessary trailing semicolon
        --> tests/test.rs:2133:6
         |
    2133 |     };
         |      ^ help: remove this semicolon
         |
         = note: `#[warn(redundant_semicolons)]` on by default

    warning: unnecessary trailing semicolon
        --> tests/test.rs:2166:6
         |
    2166 |     };
         |      ^ help: remove this semicolon
2021-02-27 20:44:53 -08:00
David Tolnay
b1ca6c7186
Add test of as_f64 on large number
Closes https://github.com/serde-rs/json/issues/710.
2020-10-12 13:35:04 -07:00
David Tolnay
509d52e70a
Simplify how regression tests are imported 2020-09-05 12:33:03 -07:00
David Tolnay
9357569b1c
Trigger missing comma rustc suggestion 2020-06-28 22:46:33 -07:00
David Tolnay
0443daa488
Prevent type ascription misdiagnosis 2020-06-28 22:38:59 -07:00
David Tolnay
4a948df6f6
Add ui test of missing comma between object entries 2020-06-28 22:24:56 -07:00
David Tolnay
43598d82f4
Gate some tests behind float_roundtrip feature 2020-06-08 21:36:27 -07:00
David Tolnay
5cb2721d5f
Add float test case demonstrating exponent overflow
thread 'test_parse_f64' panicked at 'attempt to subtract with overflow', src/de.rs:664:27
2020-06-07 23:46:40 -07:00
David Tolnay
67f3dc37dc
Format with rustfmt 2020-05-19 2020-06-07 19:53:49 -07:00
David Tolnay
24fae937ea
Deduplicate significand computation 2020-06-07 19:38:57 -07:00
David Tolnay
f0cbff81d4
Print both values on failure in lexical parse test 2020-06-07 19:21:38 -07:00
David Tolnay
ddf5f17a38
Add brief note to top of lexical sources 2020-06-07 15:20:24 -07:00
David Tolnay
3a9d27a729
Add some more number failure tests 2020-06-07 13:05:42 -07:00
David Tolnay
b1be95723e
Add roundtrip test of f32 edge case 2020-06-07 12:11:14 -07:00
David Tolnay
f753b96ddd
Ignore some clippy lints in lexical tests 2020-06-07 01:33:30 -07:00
David Tolnay
fd7168fa8e
Resolve redundant_field_names lint 2020-06-07 01:30:54 -07:00
David Tolnay
214c9ea201
Remove i32 num impls 2020-06-07 01:20:38 -07:00
David Tolnay
758d6789bd
Remove unused supertraits in lexical num library 2020-06-07 01:03:08 -07:00
David Tolnay
51392b8bf5
Remove test of removed num types 2020-06-07 00:57:01 -07:00
David Tolnay
db60f98bc3
Touch up new float roundtrip test from PR 671 2020-06-07 00:21:30 -07:00
David Tolnay
9091105d98
Remove gratuitous inline from lexical test 2020-06-07 00:10:44 -07:00
David Tolnay
7d084b2c48
Remove dead lexical test code involving radix 2020-06-07 00:10:43 -07:00
David Tolnay
664cd2d253
Move lexical unit tests to tests directory 2020-06-07 00:10:43 -07:00
David Tolnay
adafa9350c
Merge pull request #671 from japaric/gh536
tweak f64 deserialization to make float roundtrips work
2020-06-07 00:08:03 -07:00
David Tolnay
39c9499688
Format with rustfmt 2020-05-19 2020-06-06 00:03:10 -07:00
David Tolnay
e943bec750
Deal with clippy lints in tests
$ cargo clippy --tests
2020-06-06 00:01:53 -07:00
David Tolnay
b886294415
Support verifying no-std support through serde_json_test
Tested with:

    cargo check \
        --manifest-path tests/crate/Cargo.toml \
        --target aarch64-unknown-none \
        --no-default-features \
        --features alloc

which fails before this commit and succeeds after.

Before this commit:

        Checking serde_json_test v0.0.0
    error[E0463]: can't find crate for `std`
      |
      = note: the `aarch64-unknown-none` target may not be installed

    error: aborting due to previous error
2020-06-04 23:12:05 -07:00
David Tolnay
c594eb00fc
Allow but ignore trailing comma in test macros 2020-05-27 15:05:59 -07:00
David Tolnay
f38e6b5c16
Be better at computer numbering 2020-05-27 15:04:43 -07:00
Jorge Aparicio
cfd0a317fd add sample roundtrip test 2020-05-13 17:59:29 +02:00
David Tolnay
351d847e17
Omit a layer of unnecessary nesting from Debug impl 2020-05-09 16:30:09 -07:00
David Tolnay
baae6d9306
Add test for {:#?} format of Value 2020-05-09 16:27:55 -07:00
David Tolnay
a1b1199e72
Test stream behavior after error 2020-04-04 10:24:23 -07:00
David Tolnay
8d0505803b
Update ui tests to nightly-2020-02-08 2020-02-07 18:07:46 -08:00
Jean-Marc Fiaschi
0b43936690 remplace serialize key,value functions by serialize_entry
call serialize_key/value into serialize_entry
2020-02-02 17:25:24 +01:00
David Tolnay
f3b059c006
Discard unimportant lines from ui tests 2020-01-24 21:36:31 -08:00
David Tolnay
67dfe5951b
Switch rustfmt skip to tool attribute 2020-01-22 15:57:07 -08:00
David Tolnay
7cf0156d47
Switch to tool attrs 2020-01-22 14:03:12 -08:00
David Tolnay
17d9a5ea9b
Organize imports 2020-01-22 13:53:35 -08:00
David Tolnay
3040daa1c6
Update tests to 2018 edition 2020-01-22 13:45:47 -08:00
David Tolnay
c19f26a518
Update serde_json_test to 2018 edition 2020-01-22 13:43:34 -08:00
David Tolnay
ea39ccb88a
Mirror serde_json features to serde_json_test crate 2020-01-22 12:59:08 -08:00
Dean Karn
a240606c32 Add append to Map
This adds append to the Map type. There are two underlying map type ATM:
- BTreeMap
- IndexMap

For BTreeMap this exposes the existing append method which has some nice
perf benefits vs doing a for on the other map and insert on each
element.

For IndexMap there is no existing append method and so as a fallback and
convenience there is a for over the elements and insert simulating an
append.
2020-01-07 08:16:08 -08:00
Erick Tryzelaar
4ae13a5393 Implement IntoDeserializer for Value
This allows users to deserialize from types like `HashMap<String, Value>`.
2019-12-04 10:41:10 -08:00
David Tolnay
5bc17fa49a
Remove try! macro from tests 2019-10-02 21:13:55 -04:00
David Tolnay
7613c0443f
Enable testing cargo build on old compilers 2019-08-17 13:20:05 -07:00
David Tolnay
cc59b26045
Work around rust-lang/cargo#4664
Our dev-dependency on trybuild enables serde's "derive" feature, which
we don't want affecting `cargo build`.
2019-08-17 13:15:57 -07:00