Debian Codegraph @

src/de/tests.rs

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 use allocrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc crate/::{
2 borrowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/::ToOwnedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/ToOwned#,
3 formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!,
4 stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/::{Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, ToStringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/ToString#},
5 vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/,
6 vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/::Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#,
7 };
8
9 use serde_bytesrust-analyzer cargo serde_bytes 0.11.16 crate/;
10 use serde_deriverust-analyzer cargo serde_derive 1.0.228 crate/::Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:;
11
12 use craterust-analyzer cargo ron 0.12.0 crate/::{
13 errorrust-analyzer cargo ron 0.12.0 error/::{Errorrust-analyzer cargo ron 0.12.0 error/Error#, Positionrust-analyzer cargo ron 0.12.0 error/Position#, Spanrust-analyzer cargo ron 0.12.0 error/Span#, SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError#, SpannedResultrust-analyzer cargo ron 0.12.0 error/SpannedResult#},
14 parserust-analyzer cargo ron 0.12.0 parse/::Parserrust-analyzer cargo ron 0.12.0 parse/Parser#,
15 valuerust-analyzer cargo ron 0.12.0 value/::Numberrust-analyzer cargo ron 0.12.0 value/number/Number#,
16 };
17
18 #[cfg(feature = "internal-span-substring-test")]
19 use craterust-analyzer cargo ron 0.12.0 crate/::utilrust-analyzer cargo ron 0.12.0 util/::span_substringrust-analyzer cargo ron 0.12.0 util/span_substring/::check_error_span_inclusiverust-analyzer cargo ron 0.12.0 util/span_substring/check_error_span_inclusive().;
20
21 #[cfg(feature = "internal-span-substring-test")]
22 use craterust-analyzer cargo ron 0.12.0 crate/::utilrust-analyzer cargo ron 0.12.0 util/::span_substringrust-analyzer cargo ron 0.12.0 util/span_substring/::check_error_span_exclusiverust-analyzer cargo ron 0.12.0 util/span_substring/check_error_span_exclusive().;
23
24 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:)]
25 struct EmptyStruct1rust-analyzer cargo ron 0.12.0 de/tests/EmptyStruct1#;
26
27 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:)]
28 struct EmptyStruct2rust-analyzer cargo ron 0.12.0 de/tests/EmptyStruct2# {}
29
30 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:)]
31 struct NewTyperust-analyzer cargo ron 0.12.0 de/tests/NewType#(i32);
32
33 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:)]
34 #[serde(rename = "")]
35 struct UnnamedNewTyperust-analyzer cargo ron 0.12.0 de/tests/UnnamedNewType#(i32);
36
37 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:)]
38 struct TupleStructrust-analyzer cargo ron 0.12.0 de/tests/TupleStruct#(f32, f32);
39
40 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:)]
41 #[serde(rename = "")]
42 struct UnnamedTupleStructrust-analyzer cargo ron 0.12.0 de/tests/UnnamedTupleStruct#(f32, f32);
43
44 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:)]
45 struct MyStructrust-analyzer cargo ron 0.12.0 de/tests/MyStruct# {
46 xrust-analyzer cargo ron 0.12.0 de/tests/MyStruct#x.: f32,
47 yrust-analyzer cargo ron 0.12.0 de/tests/MyStruct#y.: f32,
48 }
49
50 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:)]
51 enum MyEnumrust-analyzer cargo ron 0.12.0 de/tests/MyEnum# {
52 Arust-analyzer cargo ron 0.12.0 de/tests/MyEnum#A#,
53 Brust-analyzer cargo ron 0.12.0 de/tests/MyEnum#B#(bool),
54 Crust-analyzer cargo ron 0.12.0 de/tests/MyEnum#C#(bool, f32),
55 Drust-analyzer cargo ron 0.12.0 de/tests/MyEnum#D# { arust-analyzer cargo ron 0.12.0 de/tests/MyEnum#D#a.: i32, brust-analyzer cargo ron 0.12.0 de/tests/MyEnum#D#b.: i32 },
56 }
57
58 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)]
59 struct BytesStructrust-analyzer cargo ron 0.12.0 de/tests/BytesStruct# {
60 smallrust-analyzer cargo ron 0.12.0 de/tests/BytesStruct#small.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>,
61 #[serderust-analyzer cargo serde_derive 1.0.228 serde:(with = "serde_bytes")]
62 largerust-analyzer cargo ron 0.12.0 de/tests/BytesStruct#large.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>,
63 }
64
65 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
66 fn test_empty_structrust-analyzer cargo ron 0.12.0 de/tests/test_empty_struct().() {
67 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("EmptyStruct1", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(EmptyStruct1rust-analyzer cargo ron 0.12.0 de/tests/EmptyStruct1#));
68 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("EmptyStruct2()", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(EmptyStruct2rust-analyzer cargo ron 0.12.0 de/tests/EmptyStruct2# {}));
69 }
70
71 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
72 fn test_structrust-analyzer cargo ron 0.12.0 de/tests/test_struct().() {
73 let my_struct = MyStructrust-analyzer cargo ron 0.12.0 de/tests/MyStruct# { xrust-analyzer cargo ron 0.12.0 de/tests/MyStruct#x.: 4.0, yrust-analyzer cargo ron 0.12.0 de/tests/MyStruct#y.: 7.0 };
74
75 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("MyStruct(x:4,y:7,)", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(my_struct));
76 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("(x:4,y:7)", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(my_struct));
77
78 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("NewType(42)", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(NewTyperust-analyzer cargo ron 0.12.0 de/tests/NewType#(42)));
79 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("(33)", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(NewTyperust-analyzer cargo ron 0.12.0 de/tests/NewType#(33)));
80
81 let bogus_struct = "NewType";
82 let expected_err = Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
83 coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.: Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedNamedStructLikerust-analyzer cargo ron 0.12.0 error/Error#ExpectedNamedStructLike#("NewType"),
84 spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span.: Spanrust-analyzer cargo ron 0.12.0 error/Span# {
85 startrust-analyzer cargo ron 0.12.0 error/Span#start.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 1 },
86 endrust-analyzer cargo ron 0.12.0 error/Span#end.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 8 },
87 },
88 });
89 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<NewTyperust-analyzer cargo ron 0.12.0 de/tests/NewType#>(bogus_struct, expected_err.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Clone]clone().());
90
91 #[cfg(feature = "internal-span-substring-test")]
92 check_error_span_exclusiverust-analyzer cargo ron 0.12.0 util/span_substring/check_error_span_exclusive().::<NewTyperust-analyzer cargo ron 0.12.0 de/tests/NewType#>(bogus_struct, expected_err, "NewType");
93
94 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<UnnamedNewTyperust-analyzer cargo ron 0.12.0 de/tests/UnnamedNewType#>(
95 "",
96 Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
97 coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.: Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStructLikerust-analyzer cargo ron 0.12.0 error/Error#ExpectedStructLike#,
98 spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span.: Spanrust-analyzer cargo ron 0.12.0 error/Span# {
99 startrust-analyzer cargo ron 0.12.0 error/Span#start.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 1 },
100 endrust-analyzer cargo ron 0.12.0 error/Span#end.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 1 },
101 },
102 }),
103 );
104 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("(33)", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(UnnamedNewTyperust-analyzer cargo ron 0.12.0 de/tests/UnnamedNewType#(33)));
105
106 let bogus_struct = "NewType";
107 let expected_err = Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
108 coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.: Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedNamedStructLikerust-analyzer cargo ron 0.12.0 error/Error#ExpectedNamedStructLike#(""),
109 spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span.: Spanrust-analyzer cargo ron 0.12.0 error/Span# {
110 startrust-analyzer cargo ron 0.12.0 error/Span#start.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 1 },
111 endrust-analyzer cargo ron 0.12.0 error/Span#end.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 8 },
112 },
113 });
114
115 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<UnnamedNewTyperust-analyzer cargo ron 0.12.0 de/tests/UnnamedNewType#>(bogus_struct, expected_err.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Clone]clone().());
116
117 #[cfg(feature = "internal-span-substring-test")]
118 check_error_span_exclusiverust-analyzer cargo ron 0.12.0 util/span_substring/check_error_span_exclusive().::<UnnamedNewTyperust-analyzer cargo ron 0.12.0 de/tests/UnnamedNewType#>(bogus_struct, expected_err, "NewType");
119
120 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("TupleStruct(2,5,)", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(TupleStructrust-analyzer cargo ron 0.12.0 de/tests/TupleStruct#(2.0, 5.0)));
121 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("(3,4)", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(TupleStructrust-analyzer cargo ron 0.12.0 de/tests/TupleStruct#(3.0, 4.0)));
122 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<TupleStructrust-analyzer cargo ron 0.12.0 de/tests/TupleStruct#>(
123 "",
124 Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
125 coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.: Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedNamedStructLikerust-analyzer cargo ron 0.12.0 error/Error#ExpectedNamedStructLike#("TupleStruct"),
126 spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span.: Spanrust-analyzer cargo ron 0.12.0 error/Span# {
127 startrust-analyzer cargo ron 0.12.0 error/Span#start.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 1 },
128 endrust-analyzer cargo ron 0.12.0 error/Span#end.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 1 },
129 },
130 }),
131 );
132
133 let bogus_struct = "TupleStruct(2,5,)";
134 let expected_err = Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
135 coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.: Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedNamedStructLikerust-analyzer cargo ron 0.12.0 error/Error#ExpectedNamedStructLike#(""),
136 spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span.: Spanrust-analyzer cargo ron 0.12.0 error/Span# {
137 startrust-analyzer cargo ron 0.12.0 error/Span#start.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 1 },
138 endrust-analyzer cargo ron 0.12.0 error/Span#end.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 12 },
139 },
140 });
141 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<UnnamedTupleStructrust-analyzer cargo ron 0.12.0 de/tests/UnnamedTupleStruct#>(bogus_struct, expected_err.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Clone]clone().());
142
143 #[cfg(feature = "internal-span-substring-test")]
144 check_error_span_exclusiverust-analyzer cargo ron 0.12.0 util/span_substring/check_error_span_exclusive().::<UnnamedTupleStructrust-analyzer cargo ron 0.12.0 de/tests/UnnamedTupleStruct#>(bogus_struct, expected_err, "TupleStruct");
145
146 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("(3,4)", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(UnnamedTupleStructrust-analyzer cargo ron 0.12.0 de/tests/UnnamedTupleStruct#(3.0, 4.0)));
147 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<UnnamedTupleStructrust-analyzer cargo ron 0.12.0 de/tests/UnnamedTupleStruct#>(
148 "",
149 Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
150 coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.: Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStructLikerust-analyzer cargo ron 0.12.0 error/Error#ExpectedStructLike#,
151 spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span.: Spanrust-analyzer cargo ron 0.12.0 error/Span# {
152 startrust-analyzer cargo ron 0.12.0 error/Span#start.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 1 },
153 endrust-analyzer cargo ron 0.12.0 error/Span#end.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 1 },
154 },
155 }),
156 );
157 }
158
159 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
160 fn test_unclosed_limited_seq_structrust-analyzer cargo ron 0.12.0 de/tests/test_unclosed_limited_seq_struct().() {
161 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)]
162 struct LimitedStructrust-analyzer cargo ron 0.12.0 de/tests/LimitedStruct#;
163
164 impl<'de> serderust-analyzer cargo serde 1.0.228 crate/::Deserializerust-analyzer cargo serde_core 1.0.228 de/Deserialize#<'de> for LimitedStructrust-analyzer cargo ron 0.12.0 de/tests/LimitedStruct# {
165 fn deserializerust-analyzer cargo ron 0.12.0 de/tests/impl#[LimitedStruct][`Deserialize<'de>`]deserialize().<D: serderust-analyzer cargo serde 1.0.228 crate/::Deserializerrust-analyzer cargo serde_core 1.0.228 de/Deserializer#<'de>>(deserializer: D) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/tests/impl#[LimitedStruct][`Deserialize<'de>`], D::Errorrust-analyzer cargo serde_core 1.0.228 de/Deserializer#Error#> {
166 struct Visitorrust-analyzer cargo ron 0.12.0 de/tests/Visitor#;
167
168 impl<'de> serderust-analyzer cargo serde 1.0.228 crate/::derust-analyzer cargo serde_core 1.0.228 de/::Visitorrust-analyzer cargo serde_core 1.0.228 de/Visitor#<'de> for Visitorrust-analyzer cargo ron 0.12.0 de/tests/Visitor# {
169 type Valuerust-analyzer cargo ron 0.12.0 de/tests/impl#[Visitor][`Visitor<'de>`]Value# = LimitedStructrust-analyzer cargo ron 0.12.0 de/tests/LimitedStruct#;
170
171 // GRCOV_EXCL_START
172 fn expectingrust-analyzer cargo ron 0.12.0 de/tests/impl#[Visitor][`Visitor<'de>`]expecting().(&self, fmt: &mut corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#) -> corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
173 fmt.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("struct LimitedStruct")
174 }
175 // GRCOV_EXCL_STOP
176
177 fn visit_maprust-analyzer cargo ron 0.12.0 de/tests/impl#[Visitor][`Visitor<'de>`]visit_map().<A: serderust-analyzer cargo serde 1.0.228 crate/::derust-analyzer cargo serde_core 1.0.228 de/::MapAccessrust-analyzer cargo serde_core 1.0.228 de/MapAccess#<'de>>(
178 self,
179 _map: A,
180 ) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/tests/impl#[Visitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, A::Errorrust-analyzer cargo serde_core 1.0.228 de/MapAccess#Error#> {
181 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(LimitedStructrust-analyzer cargo ron 0.12.0 de/tests/LimitedStruct#)
182 }
183 }
184
185 deserializer.deserialize_structrust-analyzer cargo serde_core 1.0.228 de/Deserializer#deserialize_struct().("LimitedStruct", &[], Visitorrust-analyzer cargo ron 0.12.0 de/tests/Visitor#)
186 }
187 }
188
189 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<LimitedStructrust-analyzer cargo ron 0.12.0 de/tests/LimitedStruct#>(
190 "(",
191 Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
192 coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.: Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStructLikeEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedStructLikeEnd#,
193 spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span.: Spanrust-analyzer cargo ron 0.12.0 error/Span# {
194 startrust-analyzer cargo ron 0.12.0 error/Span#start.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 1 },
195 endrust-analyzer cargo ron 0.12.0 error/Span#end.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 2 },
196 },
197 }),
198 )
199 }
200
201 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
202 fn test_unclosed_limited_seqrust-analyzer cargo ron 0.12.0 de/tests/test_unclosed_limited_seq().() {
203 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)]
204 struct LimitedSeqrust-analyzer cargo ron 0.12.0 de/tests/LimitedSeq#;
205
206 impl<'de> serderust-analyzer cargo serde 1.0.228 crate/::Deserializerust-analyzer cargo serde_core 1.0.228 de/Deserialize#<'de> for LimitedSeqrust-analyzer cargo ron 0.12.0 de/tests/LimitedSeq# {
207 fn deserializerust-analyzer cargo ron 0.12.0 de/tests/impl#[LimitedSeq][`Deserialize<'de>`]deserialize().<D: serderust-analyzer cargo serde 1.0.228 crate/::Deserializerrust-analyzer cargo serde_core 1.0.228 de/Deserializer#<'de>>(deserializer: D) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/tests/impl#[LimitedSeq][`Deserialize<'de>`], D::Errorrust-analyzer cargo serde_core 1.0.228 de/Deserializer#Error#> {
208 struct Visitorrust-analyzer cargo ron 0.12.0 de/tests/Visitor#;
209
210 impl<'de> serderust-analyzer cargo serde 1.0.228 crate/::derust-analyzer cargo serde_core 1.0.228 de/::Visitorrust-analyzer cargo serde_core 1.0.228 de/Visitor#<'de> for Visitorrust-analyzer cargo ron 0.12.0 de/tests/Visitor# {
211 type Valuerust-analyzer cargo ron 0.12.0 de/tests/impl#[Visitor][`Visitor<'de>`]Value# = LimitedSeqrust-analyzer cargo ron 0.12.0 de/tests/LimitedSeq#;
212
213 // GRCOV_EXCL_START
214 fn expectingrust-analyzer cargo ron 0.12.0 de/tests/impl#[Visitor][`Visitor<'de>`]expecting().(&self, fmt: &mut corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#) -> corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
215 fmt.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("an empty sequence")
216 }
217 // GRCOV_EXCL_STOP
218
219 fn visit_seqrust-analyzer cargo ron 0.12.0 de/tests/impl#[Visitor][`Visitor<'de>`]visit_seq().<A: serderust-analyzer cargo serde 1.0.228 crate/::derust-analyzer cargo serde_core 1.0.228 de/::SeqAccessrust-analyzer cargo serde_core 1.0.228 de/SeqAccess#<'de>>(
220 self,
221 _seq: A,
222 ) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/tests/impl#[Visitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, A::Errorrust-analyzer cargo serde_core 1.0.228 de/SeqAccess#Error#> {
223 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(LimitedSeqrust-analyzer cargo ron 0.12.0 de/tests/LimitedSeq#)
224 }
225 }
226
227 deserializer.deserialize_seqrust-analyzer cargo serde_core 1.0.228 de/Deserializer#deserialize_seq().(Visitorrust-analyzer cargo ron 0.12.0 de/tests/Visitor#)
228 }
229 }
230
231 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<LimitedSeqrust-analyzer cargo ron 0.12.0 de/tests/LimitedSeq#>(
232 "[",
233 Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
234 coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.: Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedArrayEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedArrayEnd#,
235 spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span.: Spanrust-analyzer cargo ron 0.12.0 error/Span# {
236 startrust-analyzer cargo ron 0.12.0 error/Span#start.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 1 },
237 endrust-analyzer cargo ron 0.12.0 error/Span#end.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 2 },
238 },
239 }),
240 );
241
242 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
243 craterust-analyzer cargo ron 0.12.0 crate/::Valuerust-analyzer cargo ron 0.12.0 value/Value#::fromrust-analyzer cargo ron 0.12.0 value/impl#[Value][`From<Vec<T>>`]from().(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![42]).into_rustrust-analyzer cargo ron 0.12.0 value/impl#[Value]into_rust().::<LimitedSeqrust-analyzer cargo ron 0.12.0 de/tests/LimitedSeq#>(),
244 Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedDifferentLengthrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentLength# {
245 expectedrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentLength#expected.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("a sequence of length 0"),
246 foundrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentLength#found.: 1
247 })
248 );
249 }
250
251 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
252 fn test_unclosed_limited_maprust-analyzer cargo ron 0.12.0 de/tests/test_unclosed_limited_map().() {
253 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)]
254 struct LimitedMaprust-analyzer cargo ron 0.12.0 de/tests/LimitedMap#;
255
256 impl<'de> serderust-analyzer cargo serde 1.0.228 crate/::Deserializerust-analyzer cargo serde_core 1.0.228 de/Deserialize#<'de> for LimitedMaprust-analyzer cargo ron 0.12.0 de/tests/LimitedMap# {
257 fn deserializerust-analyzer cargo ron 0.12.0 de/tests/impl#[LimitedMap][`Deserialize<'de>`]deserialize().<D: serderust-analyzer cargo serde 1.0.228 crate/::Deserializerrust-analyzer cargo serde_core 1.0.228 de/Deserializer#<'de>>(deserializer: D) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/tests/impl#[LimitedMap][`Deserialize<'de>`], D::Errorrust-analyzer cargo serde_core 1.0.228 de/Deserializer#Error#> {
258 struct Visitorrust-analyzer cargo ron 0.12.0 de/tests/Visitor#;
259
260 impl<'de> serderust-analyzer cargo serde 1.0.228 crate/::derust-analyzer cargo serde_core 1.0.228 de/::Visitorrust-analyzer cargo serde_core 1.0.228 de/Visitor#<'de> for Visitorrust-analyzer cargo ron 0.12.0 de/tests/Visitor# {
261 type Valuerust-analyzer cargo ron 0.12.0 de/tests/impl#[Visitor][`Visitor<'de>`]Value# = LimitedMaprust-analyzer cargo ron 0.12.0 de/tests/LimitedMap#;
262
263 // GRCOV_EXCL_START
264 fn expectingrust-analyzer cargo ron 0.12.0 de/tests/impl#[Visitor][`Visitor<'de>`]expecting().(&self, fmt: &mut corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#) -> corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
265 fmt.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("an empty map")
266 }
267 // GRCOV_EXCL_STOP
268
269 fn visit_maprust-analyzer cargo ron 0.12.0 de/tests/impl#[Visitor][`Visitor<'de>`]visit_map().<A: serderust-analyzer cargo serde 1.0.228 crate/::derust-analyzer cargo serde_core 1.0.228 de/::MapAccessrust-analyzer cargo serde_core 1.0.228 de/MapAccess#<'de>>(
270 self,
271 _map: A,
272 ) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/tests/impl#[Visitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, A::Errorrust-analyzer cargo serde_core 1.0.228 de/MapAccess#Error#> {
273 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(LimitedMaprust-analyzer cargo ron 0.12.0 de/tests/LimitedMap#)
274 }
275 }
276
277 deserializer.deserialize_maprust-analyzer cargo serde_core 1.0.228 de/Deserializer#deserialize_map().(Visitorrust-analyzer cargo ron 0.12.0 de/tests/Visitor#)
278 }
279 }
280
281 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<LimitedMaprust-analyzer cargo ron 0.12.0 de/tests/LimitedMap#>(
282 "{",
283 Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
284 coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.: Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedMapEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedMapEnd#,
285 spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span.: Spanrust-analyzer cargo ron 0.12.0 error/Span# {
286 startrust-analyzer cargo ron 0.12.0 error/Span#start.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 1 },
287 endrust-analyzer cargo ron 0.12.0 error/Span#end.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 2 },
288 },
289 }),
290 );
291
292 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
293 craterust-analyzer cargo ron 0.12.0 crate/::Valuerust-analyzer cargo ron 0.12.0 value/Value#::Maprust-analyzer cargo ron 0.12.0 value/Value#Map#([("a", 42)].into_iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/iter/impl#[`[T; N]`][IntoIterator]into_iter().().collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().()).into_rustrust-analyzer cargo ron 0.12.0 value/impl#[Value]into_rust().::<LimitedMaprust-analyzer cargo ron 0.12.0 de/tests/LimitedMap#>(),
294 Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedDifferentLengthrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentLength# {
295 expectedrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentLength#expected.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("a map of length 0"),
296 foundrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentLength#found.: 1
297 })
298 );
299 }
300
301 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
302 fn test_optionrust-analyzer cargo ron 0.12.0 de/tests/test_option().() {
303 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("Some(1)", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(1u8)));
304 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("None", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#::<u8>));
305 }
306
307 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
308 fn test_enumrust-analyzer cargo ron 0.12.0 de/tests/test_enum().() {
309 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("A", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(MyEnumrust-analyzer cargo ron 0.12.0 de/tests/MyEnum#::Arust-analyzer cargo ron 0.12.0 de/tests/MyEnum#A#));
310 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("B(true,)", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(MyEnumrust-analyzer cargo ron 0.12.0 de/tests/MyEnum#::Brust-analyzer cargo ron 0.12.0 de/tests/MyEnum#B#(true)));
311 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<MyEnumrust-analyzer cargo ron 0.12.0 de/tests/MyEnum#>(
312 "B",
313 Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
314 coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.: Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStructLikerust-analyzer cargo ron 0.12.0 error/Error#ExpectedStructLike#,
315 spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span.: Spanrust-analyzer cargo ron 0.12.0 error/Span# {
316 startrust-analyzer cargo ron 0.12.0 error/Span#start.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 1 },
317 endrust-analyzer cargo ron 0.12.0 error/Span#end.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 2 },
318 },
319 }),
320 );
321 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("C(true,3.5,)", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(MyEnumrust-analyzer cargo ron 0.12.0 de/tests/MyEnum#::Crust-analyzer cargo ron 0.12.0 de/tests/MyEnum#C#(true, 3.5)));
322 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("D(a:2,b:3,)", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(MyEnumrust-analyzer cargo ron 0.12.0 de/tests/MyEnum#::Drust-analyzer cargo ron 0.12.0 de/tests/MyEnum#D# { arust-analyzer cargo ron 0.12.0 de/tests/MyEnum#D#a.: 2, brust-analyzer cargo ron 0.12.0 de/tests/MyEnum#D#b.: 3 }));
323 }
324
325 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
326 fn test_arrayrust-analyzer cargo ron 0.12.0 de/tests/test_array().() {
327 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<[i32; 0]>("()", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#([]));
328 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("[]", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::<i32>::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().()));
329
330 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("(2,3,4,)", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#([2, 3, 4i32]));
331 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("[2,3,4,]", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#([2, 3, 4i32].to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()));
332 }
333
334 #[cfg(feature = "std")]
335 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
336 fn test_maprust-analyzer cargo ron 0.12.0 de/tests/test_map().() {
337 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::collectionsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/::HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#;
338
339 let mut map = HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V>`]new().();
340 map.insertrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S, A>`]insert().((true, false), 4);
341 map.insertrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S, A>`]insert().((false, false), 123);
342
343 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().(
344 "{
345 (true,false,):4,
346 (false,false,):123,
347 }",
348 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(map),
349 );
350 }
351
352 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
353 fn test_stringrust-analyzer cargo ron 0.12.0 de/tests/test_string().() {
354 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("\"String\"", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("String")));
355
356 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("r\"String\"", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("String")));
357 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("r#\"String\"#", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("String")));
358
359 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().(
360 "r#\"String with\nmultiple\nlines\n\"#",
361 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("String with\nmultiple\nlines\n")),
362 );
363
364 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().(
365 "r##\"String with \"#\"##",
366 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("String with \"#")),
367 );
368 }
369
370 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
371 fn test_charrust-analyzer cargo ron 0.12.0 de/tests/test_char().() {
372 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("'c'", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#('c'));
373 }
374
375 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
376 fn test_escape_charrust-analyzer cargo ron 0.12.0 de/tests/test_escape_char().() {
377 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("'\\''", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#('\''));
378 }
379
380 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
381 fn test_escaperust-analyzer cargo ron 0.12.0 de/tests/test_escape().() {
382 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().(r#""\"Quoted\"""#, Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("\"Quoted\"")));
383 }
384
385 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
386 fn test_commentrust-analyzer cargo ron 0.12.0 de/tests/test_comment().() {
387 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().(
388 "(
389 x: 1.0, // x is just 1
390 // There is another comment in the very next line..
391 // And y is indeed
392 y: 2.0 // 2!
393 )",
394 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(MyStructrust-analyzer cargo ron 0.12.0 de/tests/MyStruct# { xrust-analyzer cargo ron 0.12.0 de/tests/MyStruct#x.: 1.0, yrust-analyzer cargo ron 0.12.0 de/tests/MyStruct#y.: 2.0 }),
395 );
396 }
397
398 fn errrust-analyzer cargo ron 0.12.0 de/tests/err().<T>(
399 kind: Errorrust-analyzer cargo ron 0.12.0 error/Error#,
400 (line_start, col_start): (usize, usize),
401 (line_end, col_end): (usize, usize),
402 ) -> SpannedResultrust-analyzer cargo ron 0.12.0 error/SpannedResult#<T> {
403 Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
404 coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.: kind,
405 spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span.: Spanrust-analyzer cargo ron 0.12.0 error/Span# {
406 startrust-analyzer cargo ron 0.12.0 error/Span#start.: Positionrust-analyzer cargo ron 0.12.0 error/Position# {
407 linerust-analyzer cargo ron 0.12.0 error/Position#line.: line_start,
408 colrust-analyzer cargo ron 0.12.0 error/Position#col.: col_start,
409 },
410 endrust-analyzer cargo ron 0.12.0 error/Span#end.: Positionrust-analyzer cargo ron 0.12.0 error/Position# {
411 linerust-analyzer cargo ron 0.12.0 error/Position#line.: line_end,
412 colrust-analyzer cargo ron 0.12.0 error/Position#col.: col_end,
413 },
414 },
415 })
416 }
417
418 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
419 fn test_err_wrong_valuerust-analyzer cargo ron 0.12.0 de/tests/test_err_wrong_value().() {
420 #[cfg(feature = "std")]
421 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::collectionsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/::HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#;
422
423 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<f32>("'c'", errrust-analyzer cargo ron 0.12.0 de/tests/err().(Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedFloatrust-analyzer cargo ron 0.12.0 error/Error#ExpectedFloat#, (1, 1), (1, 1)));
424 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>("'c'", errrust-analyzer cargo ron 0.12.0 de/tests/err().(Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStringrust-analyzer cargo ron 0.12.0 error/Error#ExpectedString#, (1, 1), (1, 1)));
425 #[cfg(feature = "std")]
426 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#<u32, u32>>(
427 "'c'",
428 errrust-analyzer cargo ron 0.12.0 de/tests/err().(Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedMaprust-analyzer cargo ron 0.12.0 error/Error#ExpectedMap#, (1, 1), (1, 1)),
429 );
430 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<[u8; 5]>("'c'", errrust-analyzer cargo ron 0.12.0 de/tests/err().(Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStructLikerust-analyzer cargo ron 0.12.0 error/Error#ExpectedStructLike#, (1, 1), (1, 1)));
431 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u32>>("'c'", errrust-analyzer cargo ron 0.12.0 de/tests/err().(Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedArrayrust-analyzer cargo ron 0.12.0 error/Error#ExpectedArray#, (1, 1), (1, 1)));
432 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<MyEnumrust-analyzer cargo ron 0.12.0 de/tests/MyEnum#>("'c'", errrust-analyzer cargo ron 0.12.0 de/tests/err().(Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedIdentifierrust-analyzer cargo ron 0.12.0 error/Error#ExpectedIdentifier#, (1, 1), (1, 1)));
433 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<MyStructrust-analyzer cargo ron 0.12.0 de/tests/MyStruct#>(
434 "'c'",
435 errrust-analyzer cargo ron 0.12.0 de/tests/err().(Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedNamedStructLikerust-analyzer cargo ron 0.12.0 error/Error#ExpectedNamedStructLike#("MyStruct"), (1, 1), (1, 1)),
436 );
437 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<MyStructrust-analyzer cargo ron 0.12.0 de/tests/MyStruct#>(
438 "NotMyStruct(x: 4, y: 2)",
439 errrust-analyzer cargo ron 0.12.0 de/tests/err().(
440 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedDifferentStructNamerust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentStructName# {
441 expectedrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentStructName#expected.: "MyStruct",
442 foundrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentStructName#found.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("NotMyStruct"),
443 },
444 (1, 1),
445 (1, 12),
446 ),
447 );
448 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<(u8, bool)>(
449 "'c'",
450 errrust-analyzer cargo ron 0.12.0 de/tests/err().(Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStructLikerust-analyzer cargo ron 0.12.0 error/Error#ExpectedStructLike#, (1, 1), (1, 1)),
451 );
452 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<bool>("notabool", errrust-analyzer cargo ron 0.12.0 de/tests/err().(Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedBooleanrust-analyzer cargo ron 0.12.0 error/Error#ExpectedBoolean#, (1, 1), (1, 1)));
453
454 let bogus_struct = "MyStruct(\n x: true)";
455 let expected_err = errrust-analyzer cargo ron 0.12.0 de/tests/err().(Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedFloatrust-analyzer cargo ron 0.12.0 error/Error#ExpectedFloat#, (2, 7), (2, 8));
456
457 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<MyStructrust-analyzer cargo ron 0.12.0 de/tests/MyStruct#>(bogus_struct, expected_err.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Clone]clone().());
458
459 #[cfg(feature = "internal-span-substring-test")]
460 check_error_span_inclusiverust-analyzer cargo ron 0.12.0 util/span_substring/check_error_span_inclusive().::<MyStructrust-analyzer cargo ron 0.12.0 de/tests/MyStruct#>(bogus_struct, expected_err, " t");
461
462 let bogus_struct = "MyStruct(\n x: 3.5, \n y:)";
463 let expected_err = errrust-analyzer cargo ron 0.12.0 de/tests/err().(Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedFloatrust-analyzer cargo ron 0.12.0 error/Error#ExpectedFloat#, (3, 7), (3, 7));
464
465 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<MyStructrust-analyzer cargo ron 0.12.0 de/tests/MyStruct#>(bogus_struct, expected_err.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Clone]clone().());
466
467 #[cfg(feature = "internal-span-substring-test")]
468 check_error_span_inclusiverust-analyzer cargo ron 0.12.0 util/span_substring/check_error_span_inclusive().::<MyStructrust-analyzer cargo ron 0.12.0 de/tests/MyStruct#>(bogus_struct, expected_err, ")");
469 }
470
471 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
472 fn test_perm_wsrust-analyzer cargo ron 0.12.0 de/tests/test_perm_ws().() {
473 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().(
474 "\nMyStruct \t ( \n x : 3.5 , \t y\n: 4.5 \n ) \t\n",
475 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(MyStructrust-analyzer cargo ron 0.12.0 de/tests/MyStruct# { xrust-analyzer cargo ron 0.12.0 de/tests/MyStruct#x.: 3.5, yrust-analyzer cargo ron 0.12.0 de/tests/MyStruct#y.: 4.5 }),
476 );
477 }
478
479 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
480 fn untaggedrust-analyzer cargo ron 0.12.0 de/tests/untagged().() {
481 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)]
482 #[serde(untagged)]
483 enum Untaggedrust-analyzer cargo ron 0.12.0 de/tests/Untagged# {
484 U8rust-analyzer cargo ron 0.12.0 de/tests/Untagged#U8#(u8),
485 Boolrust-analyzer cargo ron 0.12.0 de/tests/Untagged#Bool#(bool),
486 Valuerust-analyzer cargo ron 0.12.0 de/tests/Untagged#Value#(craterust-analyzer cargo ron 0.12.0 crate/::Valuerust-analyzer cargo ron 0.12.0 value/Value#),
487 }
488
489 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("true", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Untaggedrust-analyzer cargo ron 0.12.0 de/tests/Untagged#::Boolrust-analyzer cargo ron 0.12.0 de/tests/Untagged#Bool#(true)));
490 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("8", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Untaggedrust-analyzer cargo ron 0.12.0 de/tests/Untagged#::U8rust-analyzer cargo ron 0.12.0 de/tests/Untagged#U8#(8)));
491
492 // Check for a failure in Deserializer::check_struct_type
493 // - untagged enum and a leading identifier trigger the serde content enum path
494 // - serde content uses deserialize_any, which retriggers the struct type check
495 // - struct type check inside a serde content performs a full newtype check
496 // - newtype check fails on the unclosed struct
497 //
498 let bogus_struct = "Value(()";
499 let expected_err = Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(craterust-analyzer cargo ron 0.12.0 crate/::errorrust-analyzer cargo ron 0.12.0 error/::SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
500 coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.: craterust-analyzer cargo ron 0.12.0 crate/::Errorrust-analyzer cargo ron 0.12.0 error/Error#::Eofrust-analyzer cargo ron 0.12.0 error/Error#Eof#,
501 spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span.: Spanrust-analyzer cargo ron 0.12.0 error/Span# {
502 startrust-analyzer cargo ron 0.12.0 error/Span#start.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 8 },
503 endrust-analyzer cargo ron 0.12.0 error/Span#end.: craterust-analyzer cargo ron 0.12.0 crate/::errorrust-analyzer cargo ron 0.12.0 error/::Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 9 },
504 },
505 });
506 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<Untaggedrust-analyzer cargo ron 0.12.0 de/tests/Untagged#>(bogus_struct, expected_err.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Clone]clone().());
507
508 #[cfg(feature = "internal-span-substring-test")]
509 check_error_span_exclusiverust-analyzer cargo ron 0.12.0 util/span_substring/check_error_span_exclusive().::<Untaggedrust-analyzer cargo ron 0.12.0 de/tests/Untagged#>(bogus_struct, expected_err, ")");
510 }
511
512 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
513 fn renamerust-analyzer cargo ron 0.12.0 de/tests/rename().() {
514 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)]
515 enum Foorust-analyzer cargo ron 0.12.0 de/tests/Foo# {
516 #[serderust-analyzer cargo serde_derive 1.0.228 serde:(rename = "2d")]
517 D2rust-analyzer cargo ron 0.12.0 de/tests/Foo#D2#,
518 #[serderust-analyzer cargo serde_derive 1.0.228 serde:(rename = "triangle-list")]
519 TriangleListrust-analyzer cargo ron 0.12.0 de/tests/Foo#TriangleList#,
520 }
521
522 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("r#2d", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Foorust-analyzer cargo ron 0.12.0 de/tests/Foo#::D2rust-analyzer cargo ron 0.12.0 de/tests/Foo#D2#));
523 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("r#triangle-list", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Foorust-analyzer cargo ron 0.12.0 de/tests/Foo#::TriangleListrust-analyzer cargo ron 0.12.0 de/tests/Foo#TriangleList#));
524 }
525
526 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
527 fn forgot_apostrophesrust-analyzer cargo ron 0.12.0 de/tests/forgot_apostrophes().() {
528 let bogus_struct = "(4, \"Hello)";
529 let expected_err = Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
530 coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.: Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStringEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedStringEnd#,
531 spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span.: Spanrust-analyzer cargo ron 0.12.0 error/Span# {
532 startrust-analyzer cargo ron 0.12.0 error/Span#start.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 5 },
533 endrust-analyzer cargo ron 0.12.0 error/Span#end.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 6 },
534 },
535 });
536
537 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<(i32, Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#)>(bogus_struct, expected_err.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Clone]clone().());
538
539 #[cfg(feature = "internal-span-substring-test")]
540 check_error_span_exclusiverust-analyzer cargo ron 0.12.0 util/span_substring/check_error_span_exclusive().::<(i32, Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#)>(bogus_struct, expected_err, "\"");
541 }
542
543 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
544 fn expected_attributerust-analyzer cargo ron 0.12.0 de/tests/expected_attribute().() {
545 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>(
546 "#\"Hello\"",
547 errrust-analyzer cargo ron 0.12.0 de/tests/err().(Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedAttributerust-analyzer cargo ron 0.12.0 error/Error#ExpectedAttribute#, (1, 2), (1, 2)),
548 );
549 }
550
551 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
552 fn expected_attribute_endrust-analyzer cargo ron 0.12.0 de/tests/expected_attribute_end().() {
553 let bogus_struct = "#![enable(unwrap_newtypes) \"Hello\"";
554 let expected_err = errrust-analyzer cargo ron 0.12.0 de/tests/err().(Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedAttributeEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedAttributeEnd#, (1, 27), (1, 28));
555 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>(bogus_struct, expected_err.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Clone]clone().());
556
557 #[cfg(feature = "internal-span-substring-test")]
558 check_error_span_inclusiverust-analyzer cargo ron 0.12.0 util/span_substring/check_error_span_inclusive().::<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>(bogus_struct, expected_err, " \"");
559 }
560
561 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
562 fn invalid_attributerust-analyzer cargo ron 0.12.0 de/tests/invalid_attribute().() {
563 let bogus_struct = "#![enable(invalid)] \"Hello\"";
564 let expected_err = errrust-analyzer cargo ron 0.12.0 de/tests/err().(
565 Errorrust-analyzer cargo ron 0.12.0 error/Error#::NoSuchExtensionrust-analyzer cargo ron 0.12.0 error/Error#NoSuchExtension#("invalid".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()),
566 (1, 11),
567 (1, 18),
568 );
569 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>(bogus_struct, expected_err.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Clone]clone().());
570
571 #[cfg(feature = "internal-span-substring-test")]
572 check_error_span_exclusiverust-analyzer cargo ron 0.12.0 util/span_substring/check_error_span_exclusive().::<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>(bogus_struct, expected_err, "invalid");
573 }
574
575 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
576 fn multiple_attributesrust-analyzer cargo ron 0.12.0 de/tests/multiple_attributes().() {
577 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)]
578 struct Newrust-analyzer cargo ron 0.12.0 de/tests/New#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#);
579
580 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().(
581 "#![enable(unwrap_newtypes)] #![enable(unwrap_newtypes)] \"Hello\"",
582 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Newrust-analyzer cargo ron 0.12.0 de/tests/New#("Hello".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().())),
583 );
584 }
585
586 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
587 fn uglified_attributerust-analyzer cargo ron 0.12.0 de/tests/uglified_attribute().() {
588 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().(
589 "# !\
590 // We definitely want to add a comment here
591 [\t\tenable( // best style ever
592 unwrap_newtypes ) ] ()",
593 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()),
594 );
595 }
596
597 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
598 fn implicit_somerust-analyzer cargo ron 0.12.0 de/tests/implicit_some().() {
599 use serderust-analyzer cargo serde 1.0.228 crate/::derust-analyzer cargo serde_core 1.0.228 de/::DeserializeOwnedrust-analyzer cargo serde_core 1.0.228 de/DeserializeOwned#;
600
601 fn derust-analyzer cargo ron 0.12.0 de/tests/de().<T: DeserializeOwnedrust-analyzer cargo serde_core 1.0.228 de/DeserializeOwned#>(s: &str) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<T> {
602 let enable = "#![enable(implicit_some)]\n".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().();
603
604 superrust-analyzer cargo ron 0.12.0 de/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<T>>(&(enable rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`Add<&str>`]add().+rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`Add<&str>`]add(). rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`Add<&str>`]add().s)).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()
605 }
606
607 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(derust-analyzer cargo ron 0.12.0 de/tests/de().("'c'"), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('c'));
608 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(derust-analyzer cargo ron 0.12.0 de/tests/de().("5"), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(5));
609 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(derust-analyzer cargo ron 0.12.0 de/tests/de().("\"Hello\""), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#("Hello".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()));
610 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(derust-analyzer cargo ron 0.12.0 de/tests/de().("false"), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(false));
611 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
612 derust-analyzer cargo ron 0.12.0 de/tests/de().("MyStruct(x: .4, y: .5)"),
613 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(MyStructrust-analyzer cargo ron 0.12.0 de/tests/MyStruct# { xrust-analyzer cargo ron 0.12.0 de/tests/MyStruct#x.: 0.4, yrust-analyzer cargo ron 0.12.0 de/tests/MyStruct#y.: 0.5 })
614 );
615
616 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(derust-analyzer cargo ron 0.12.0 de/tests/de().::<char>("None"), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#);
617
618 // Not concise
619 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(derust-analyzer cargo ron 0.12.0 de/tests/de().::<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<char>>>("None"), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#);
620 }
621
622 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
623 fn ws_tuple_newtype_variantrust-analyzer cargo ron 0.12.0 de/tests/ws_tuple_newtype_variant().() {
624 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().("B ( \n true \n ) ", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(MyEnumrust-analyzer cargo ron 0.12.0 de/tests/MyEnum#::Brust-analyzer cargo ron 0.12.0 de/tests/MyEnum#B#(true)));
625 }
626
627 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
628 fn test_byte_streamrust-analyzer cargo ron 0.12.0 de/tests/test_byte_stream().() {
629 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().(
630 "BytesStruct( small:[1, 2], large:b\"\\x01\\x02\\x03\\x04\" )",
631 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(BytesStructrust-analyzer cargo ron 0.12.0 de/tests/BytesStruct# {
632 smallrust-analyzer cargo ron 0.12.0 de/tests/BytesStruct#small.: vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![1, 2],
633 largerust-analyzer cargo ron 0.12.0 de/tests/BytesStruct#large.: vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![1, 2, 3, 4],
634 }),
635 );
636 }
637
638 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
639 fn test_numbersrust-analyzer cargo ron 0.12.0 de/tests/test_numbers().() {
640 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().(
641 "[1_234, 12_345, 1_2_3_4_5_6, 1_234_567, 5_55_55_5]",
642 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![1234, 12345, 123_456, 1_234_567, 555_555]),
643 );
644 }
645
646 fn check_de_any_numberrust-analyzer cargo ron 0.12.0 de/tests/check_de_any_number().<
647 T: Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy# + PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq# + corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# + Intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/Into#<Numberrust-analyzer cargo ron 0.12.0 value/number/Number#> + serderust-analyzer cargo serde 1.0.228 crate/::derust-analyzer cargo serde_core 1.0.228 de/::DeserializeOwnedrust-analyzer cargo serde_core 1.0.228 de/DeserializeOwned#,
648 >(
649 s: &str,
650 cmp: T,
651 ) {
652 let mut parser = Parserrust-analyzer cargo ron 0.12.0 parse/Parser#::newrust-analyzer cargo ron 0.12.0 parse/impl#[`Parser<'a>`]new().(s).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
653 let number = parser.any_numberrust-analyzer cargo ron 0.12.0 parse/impl#[`Parser<'a>`]any_number().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
654
655 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(number, Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::newrust-analyzer cargo ron 0.12.0 value/number/impl#[Number]new().(cmp));
656 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
657 Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::newrust-analyzer cargo ron 0.12.0 value/number/impl#[Number]new().(superrust-analyzer cargo ron 0.12.0 de/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<T>(s).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()),
658 Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::newrust-analyzer cargo ron 0.12.0 value/number/impl#[Number]new().(cmp)
659 );
660 }
661
662 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
663 fn test_any_number_precisionrust-analyzer cargo ron 0.12.0 de/tests/test_any_number_precision().() {
664 check_de_any_numberrust-analyzer cargo ron 0.12.0 de/tests/check_de_any_number().("1", 1_u8);
665 check_de_any_numberrust-analyzer cargo ron 0.12.0 de/tests/check_de_any_number().("+1", 1_u8);
666 check_de_any_numberrust-analyzer cargo ron 0.12.0 de/tests/check_de_any_number().("-1", -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][Neg]neg().1_i8);
667 check_de_any_numberrust-analyzer cargo ron 0.12.0 de/tests/check_de_any_number().("-1.0", -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().1.0_f32);
668 check_de_any_numberrust-analyzer cargo ron 0.12.0 de/tests/check_de_any_number().("1.", 1.0_f32);
669 check_de_any_numberrust-analyzer cargo ron 0.12.0 de/tests/check_de_any_number().("-1.", -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().1.0_f32);
670 check_de_any_numberrust-analyzer cargo ron 0.12.0 de/tests/check_de_any_number().(".3", 0.3_f64);
671 check_de_any_numberrust-analyzer cargo ron 0.12.0 de/tests/check_de_any_number().("-.3", -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][Neg]neg().0.3_f64);
672 check_de_any_numberrust-analyzer cargo ron 0.12.0 de/tests/check_de_any_number().("+.3", 0.3_f64);
673 check_de_any_numberrust-analyzer cargo ron 0.12.0 de/tests/check_de_any_number().("0.3", 0.3_f64);
674 check_de_any_numberrust-analyzer cargo ron 0.12.0 de/tests/check_de_any_number().("NaN", f32::NANrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]NAN.);
•675 #[cfg(not(target_arch="riscv64"))]
676 check_de_any_numberrust-analyzer cargo ron 0.12.0 de/tests/check_de_any_number().("-NaN", -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().f32::NANrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]NAN.);
677 check_de_any_numberrust-analyzer cargo ron 0.12.0 de/tests/check_de_any_number().("inf", f32::INFINITYrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]INFINITY.);
678 check_de_any_numberrust-analyzer cargo ron 0.12.0 de/tests/check_de_any_number().("-inf", f32::NEG_INFINITYrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]NEG_INFINITY.);
679
680 macro_rules! test_minrust-analyzer cargo ron 0.12.0 de/tests/test_min! {
681 ($($ty:ty),*) => {
682 $(check_de_any_number(&format!("{}", <$ty>::MIN), <$ty>::MIN);)*
683 };
684 }
685
686 macro_rules! test_maxrust-analyzer cargo ron 0.12.0 de/tests/test_max! {
687 ($($ty:ty),*) => {
688 $(check_de_any_number(&format!("{}", <$ty>::MAX), <$ty>::MAX);)*
689 };
690 }
691
692 test_minrust-analyzer cargo ron 0.12.0 de/tests/test_min!! { i8, i16, i32, i64, f64 }
693 test_maxrust-analyzer cargo ron 0.12.0 de/tests/test_max!! { u8, u16, u32, u64, f64 }
694 #[cfg(feature = "integer128")]
695 test_minrust-analyzer cargo ron 0.12.0 de/tests/test_min!! { i128 }
696 #[cfg(feature = "integer128")]
697 test_maxrust-analyzer cargo ron 0.12.0 de/tests/test_max!! { u128 }
698 }
699
700 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
701 fn test_value_special_floatsrust-analyzer cargo ron 0.12.0 de/tests/test_value_special_floats().() {
702 use craterust-analyzer cargo ron 0.12.0 crate/::{from_strrust-analyzer cargo ron 0.12.0 de/from_str()., valuerust-analyzer cargo ron 0.12.0 value/::Numberrust-analyzer cargo ron 0.12.0 value/number/Number#, Valuerust-analyzer cargo ron 0.12.0 value/Value#};
703
704 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
705 from_strrust-analyzer cargo ron 0.12.0 de/from_str().("NaN"),
706 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::F32rust-analyzer cargo ron 0.12.0 value/number/Number#F32#(f32::NANrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]NAN..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())))
707 );
708 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
709 from_strrust-analyzer cargo ron 0.12.0 de/from_str().("+NaN"),
710 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::F32rust-analyzer cargo ron 0.12.0 value/number/Number#F32#(f32::NANrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]NAN..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())))
711 );
•712 #[cfg(not(target_arch="riscv64"))]
713 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
714 from_strrust-analyzer cargo ron 0.12.0 de/from_str().("-NaN"),
715 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::F32rust-analyzer cargo ron 0.12.0 value/number/Number#F32#((-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().f32::NANrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]NAN.).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())))
716 );
717
718 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
719 from_strrust-analyzer cargo ron 0.12.0 de/from_str().("inf"),
720 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::F32rust-analyzer cargo ron 0.12.0 value/number/Number#F32#(f32::INFINITYrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]INFINITY..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())))
721 );
722 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
723 from_strrust-analyzer cargo ron 0.12.0 de/from_str().("+inf"),
724 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::F32rust-analyzer cargo ron 0.12.0 value/number/Number#F32#(f32::INFINITYrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]INFINITY..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())))
725 );
726 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
727 from_strrust-analyzer cargo ron 0.12.0 de/from_str().("-inf"),
728 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::F32rust-analyzer cargo ron 0.12.0 value/number/Number#F32#(f32::NEG_INFINITYrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]NEG_INFINITY..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())))
729 );
730 }
731
732 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
733 fn test_leading_whitespacerust-analyzer cargo ron 0.12.0 de/tests/test_leading_whitespace().() {
734 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().(" +1", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(1_u8));
735 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().(" EmptyStruct1", Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(EmptyStruct1rust-analyzer cargo ron 0.12.0 de/tests/EmptyStruct1#));
736 }
737
738 fn check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().<T: serderust-analyzer cargo serde 1.0.228 crate/::derust-analyzer cargo serde_core 1.0.228 de/::DeserializeOwnedrust-analyzer cargo serde_core 1.0.228 de/DeserializeOwned# + PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq# + corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug#>(
739 ron: &str,
740 check: SpannedResultrust-analyzer cargo ron 0.12.0 error/SpannedResult#<T>,
741 ) {
742 let res_str = superrust-analyzer cargo ron 0.12.0 de/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<T>(ron);
743 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res_str, check);
744
745 let res_bytes = superrust-analyzer cargo ron 0.12.0 de/::from_bytesrust-analyzer cargo ron 0.12.0 de/from_bytes().::<T>(ron.as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().());
746 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res_bytes, check);
747
748 #[cfg(feature = "std")]
749 {
750 let res_reader = superrust-analyzer cargo ron 0.12.0 de/::from_readerrust-analyzer cargo ron 0.12.0 de/from_reader().::<&[u8], T>(ron.as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().());
751 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res_reader, check);
752 }
753 }
754
755 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
756 fn test_remainderrust-analyzer cargo ron 0.12.0 de/tests/test_remainder().() {
757 let mut deserializer = superrust-analyzer cargo ron 0.12.0 de/::Deserializerrust-analyzer cargo ron 0.12.0 de/Deserializer#::from_strrust-analyzer cargo ron 0.12.0 de/impl#[`Deserializer<'de>`]from_str().(" 42 ").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
758 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
759 <u8 as serderust-analyzer cargo serde 1.0.228 crate/::Deserializerust-analyzer cargo serde_core 1.0.228 de/Deserialize#>::deserializerust-analyzer cargo serde_core 1.0.228 de/impls/impl#[u8][`Deserialize<'de>`]deserialize().(&mut deserializer).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(),
760 42
761 );
762 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(deserializer.remainderrust-analyzer cargo ron 0.12.0 de/impl#[`Deserializer<'de>`]remainder().(), " ");
763 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(deserializer.endrust-analyzer cargo ron 0.12.0 de/impl#[`Deserializer<'de>`]end().(), Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()));
764
765 let mut deserializer = superrust-analyzer cargo ron 0.12.0 de/::Deserializerrust-analyzer cargo ron 0.12.0 de/Deserializer#::from_strrust-analyzer cargo ron 0.12.0 de/impl#[`Deserializer<'de>`]from_str().(" 42 37 ").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
766 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
767 <u8 as serderust-analyzer cargo serde 1.0.228 crate/::Deserializerust-analyzer cargo serde_core 1.0.228 de/Deserialize#>::deserializerust-analyzer cargo serde_core 1.0.228 de/impls/impl#[u8][`Deserialize<'de>`]deserialize().(&mut deserializer).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(),
768 42
769 );
770 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(deserializer.remainderrust-analyzer cargo ron 0.12.0 de/impl#[`Deserializer<'de>`]remainder().(), " 37 ");
771 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(deserializer.endrust-analyzer cargo ron 0.12.0 de/impl#[`Deserializer<'de>`]end().(), Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo ron 0.12.0 error/Error#::TrailingCharactersrust-analyzer cargo ron 0.12.0 error/Error#TrailingCharacters#));
772 }
773
774 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
775 fn boolean_struct_namerust-analyzer cargo ron 0.12.0 de/tests/boolean_struct_name().() {
776 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<bool>(
777 "true_",
778 Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
779 coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.: Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedBooleanrust-analyzer cargo ron 0.12.0 error/Error#ExpectedBoolean#,
780 spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span.: Spanrust-analyzer cargo ron 0.12.0 error/Span# {
781 startrust-analyzer cargo ron 0.12.0 error/Span#start.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 1 },
782 endrust-analyzer cargo ron 0.12.0 error/Span#end.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 1 },
783 },
784 }),
785 );
786 check_from_str_bytes_readerrust-analyzer cargo ron 0.12.0 de/tests/check_from_str_bytes_reader().::<bool>(
787 "false_",
788 Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
789 coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.: Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedBooleanrust-analyzer cargo ron 0.12.0 error/Error#ExpectedBoolean#,
790 spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span.: Spanrust-analyzer cargo ron 0.12.0 error/Span# {
791 startrust-analyzer cargo ron 0.12.0 error/Span#start.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 1 },
792 endrust-analyzer cargo ron 0.12.0 error/Span#end.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 1 },
793 },
794 }),
795 );
796 }