148 Commits

Author SHA1 Message Date
David Tolnay
019b179cf7
Ui test changes for trybuild 1.0.49 2021-10-08 03:00:04 -04:00
David Tolnay
733b353394
Update ui test files 2021-10-07 00:19:07 -04:00
David Tolnay
9298f54ace
Resolve manual_str_repeat clippy lint 2021-10-01 01:11:06 -04:00
David Tolnay
019041e4d5
Resolve semicolon_if_nothing_returned pedantic clippy lint
error: consider adding a `;` to the last statement for consistent formatting
       --> tests/../src/lexical/float.rs:111:9
        |
    111 |         round_to_native::<F, _>(self, algorithm)
        |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `round_to_native::<F, _>(self, algorithm);`
        |
        = note: `-D clippy::semicolon-if-nothing-returned` implied by `-D clippy::pedantic`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

    error: consider adding a `;` to the last statement for consistent formatting
       --> tests/../src/lexical/math.rs:616:9
        |
    616 |         iadd_impl(x, y, 0)
        |         ^^^^^^^^^^^^^^^^^^ help: add a `;` here: `iadd_impl(x, y, 0);`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

    error: consider adding a `;` to the last statement for consistent formatting
       --> tests/../src/lexical/math.rs:862:9
        |
    862 |         self.ishl(n as usize)
        |         ^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `self.ishl(n as usize);`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

    error: consider adding a `;` to the last statement for consistent formatting
       --> tests/../src/lexical/math.rs:868:9
        |
    868 |         small::imul_pow5(self.data_mut(), n)
        |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `small::imul_pow5(self.data_mut(), n);`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

    error: consider adding a `;` to the last statement for consistent formatting
       --> tests/lexical/float.rs:184:5
        |
    184 |     check_round_to_f64(10234494226754558294, -1086, 2498655817078750, -1074)
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `check_round_to_f64(10234494226754558294, -1086, 2498655817078750, -1074);`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
2021-10-01 01:09:12 -04:00
David Tolnay
0b5931550a
Resolve needless_borrow clippy lint
error: this expression borrows a reference (`&lexical::float::ExtendedFloat`) that is immediately dereferenced by the compiler
       --> tests/../src/lexical/algorithm.rs:136:45
        |
    136 |         u64::error_is_accurate::<F>(errors, &fp)
        |                                             ^^^ help: change this to: `fp`
        |
        = note: `-D clippy::needless-borrow` implied by `-D clippy::all`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
2021-10-01 01:07:42 -04:00
David Tolnay
fc4db0306a
Run clippy on test suite too 2021-10-01 00:46:45 -04:00
David Tolnay
f5219be867
Add test parsing -0 2021-09-14 12:52:55 -07:00
David Tolnay
b419f2e065
Test negative zero parsing to f32 2021-09-14 12:51:27 -07:00
David Tolnay
ef823af7d5
Suppress unused field in test_borrow_in_map_key
warning: field is never read: `map`
        --> tests/test.rs:2233:9
         |
    2233 |         map: BTreeMap<MyMapKey, ()>,
         |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = note: `#[warn(dead_code)]` on by default
2021-09-14 12:50:03 -07:00
David Tolnay
f4fc150c45
Fix dead code warning in issue 795 regression test
warning: field is never read: `x`
     --> tests/regression/issue795.rs:9:15
      |
    9 |     Variant { x: u8 },
      |               ^^^^^
      |
      = note: `#[warn(dead_code)]` on by default
2021-09-14 12:49:18 -07:00
David Tolnay
12207ed2a3
Add regression test for issue 795 2021-08-28 11:21:40 -07:00
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