mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-28 09:07:57 +00:00
Update PR 2562 ui tests
This commit is contained in:
@@ -5,13 +5,10 @@ use serde_derive::Deserialize;
|
||||
#[derive(Deserialize)]
|
||||
enum E {
|
||||
S1 {
|
||||
/// Expected error on "alias b", because this is a name of other field
|
||||
/// Error on "alias a" is not expected because this is a name of this field
|
||||
/// Error on "alias c" is not expected because field `c` is skipped
|
||||
#[serde(alias = "a", alias = "b", alias = "c")]
|
||||
a: (),
|
||||
|
||||
/// Expected error on "alias c", because it is already used as alias of `a`
|
||||
// Warning on "c" and "b"
|
||||
#[serde(alias = "c")]
|
||||
b: (),
|
||||
|
||||
@@ -20,34 +17,31 @@ enum E {
|
||||
},
|
||||
|
||||
S2 {
|
||||
/// Expected error on "alias c", because this is a name of other field after
|
||||
/// applying rename rules
|
||||
#[serde(alias = "b", alias = "c")]
|
||||
a: (),
|
||||
|
||||
// Warning on "c"
|
||||
#[serde(rename = "c")]
|
||||
b: (),
|
||||
},
|
||||
|
||||
#[serde(rename_all = "UPPERCASE")]
|
||||
S3 {
|
||||
/// Expected error on "alias B", because this is a name of field after
|
||||
/// applying rename rules
|
||||
#[serde(alias = "B", alias = "c")]
|
||||
a: (),
|
||||
|
||||
// Warning on "b" because this collides with the "B" above after
|
||||
// applying rename rules
|
||||
b: (),
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
enum E1 {
|
||||
/// Expected error on "alias b", because this is a name of other variant
|
||||
/// Error on "alias a" is not expected because this is a name of this variant
|
||||
/// Error on "alias c" is not expected because variant `c` is skipped
|
||||
#[serde(alias = "a", alias = "b", alias = "c")]
|
||||
a,
|
||||
|
||||
/// Expected error on "alias c", because it is already used as alias of `a`
|
||||
// Warning on "c" and "b"
|
||||
#[serde(alias = "c")]
|
||||
b,
|
||||
|
||||
@@ -57,11 +51,10 @@ enum E1 {
|
||||
|
||||
#[derive(Deserialize)]
|
||||
enum E2 {
|
||||
/// Expected error on "alias c", because this is a name of other variant after
|
||||
/// applying rename rules
|
||||
#[serde(alias = "b", alias = "c")]
|
||||
a,
|
||||
|
||||
// Warning on "c"
|
||||
#[serde(rename = "c")]
|
||||
b,
|
||||
}
|
||||
@@ -69,10 +62,11 @@ enum E2 {
|
||||
#[derive(Deserialize)]
|
||||
#[serde(rename_all = "UPPERCASE")]
|
||||
enum E3 {
|
||||
/// Expected error on "alias B", because this is a name of variant after
|
||||
/// applying rename rules
|
||||
#[serde(alias = "B", alias = "c")]
|
||||
a,
|
||||
|
||||
// Warning on "b" because this collides with the "B" above after applying
|
||||
// rename rules
|
||||
b,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user