Skip to content

Commit

Permalink
Update tests with clone
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
  • Loading branch information
patrickelectric committed Sep 19, 2024
1 parent 3a33133 commit 075f6b0
Show file tree
Hide file tree
Showing 20 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions wsdl-parser/tests/port_type_to_function/expected.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tds", namespace = "tds: http://www.onvif.org/ver10/device/wsdl")]
pub struct GetServices {
// Indicates if the service capabilities (untyped) should be included in the
Expand All @@ -11,7 +11,7 @@ pub struct GetServices {
impl Validate for GetServices {}


#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tds", namespace = "tds: http://www.onvif.org/ver10/device/wsdl")]
pub struct GetServicesResponse {
// Each Service element contains information about one service.
Expand Down
2 changes: 1 addition & 1 deletion xsd-parser/src/generator/enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub trait EnumGenerator {
return "#[derive(PartialEq, Debug, UtilsUnionSerDe)]".into();
}

let derives = "#[derive(PartialEq, Debug, YaSerialize, YaDeserialize)]";
let derives = "#[derive(PartialEq, Debug, Clone, YaSerialize, YaDeserialize)]";
let tns = gen.target_ns.borrow();
match tns.as_ref() {
Some(tn) => match tn.name() {
Expand Down
2 changes: 1 addition & 1 deletion xsd-parser/tests/all/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct FooType {
#[yaserde(prefix = "tns", rename = "Once")]
Expand Down
2 changes: 1 addition & 1 deletion xsd-parser/tests/any/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct FooType {
#[yaserde(prefix = "tns", rename = "Name")]
Expand Down
8 changes: 4 additions & 4 deletions xsd-parser/tests/choice/expected.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
pub struct BarType(pub String);

#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
pub struct BazType(pub i32);

#[derive(PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(PartialEq, Debug, Clone, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub enum FooTypeChoice {
Bar(BarType),
Expand All @@ -18,7 +18,7 @@ impl Default for FooTypeChoice {
}
}

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct FooType {
#[yaserde(flatten)]
Expand Down
2 changes: 1 addition & 1 deletion xsd-parser/tests/complex_type/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct FooType {
#[yaserde(prefix = "tns", rename = "Min")]
Expand Down
8 changes: 4 additions & 4 deletions xsd-parser/tests/complex_type_subtypes_clash/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct FooType {
#[yaserde(prefix = "tns", rename = "Extension")]
Expand All @@ -10,14 +10,14 @@ impl Validate for FooType {}
pub mod foo_type {
use super::*;

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct ExtensionType {}

impl Validate for ExtensionType {}
}

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct BarType {
#[yaserde(prefix = "tns", rename = "Extension")]
Expand All @@ -29,7 +29,7 @@ impl Validate for BarType {}
pub mod bar_type {
use super::*;

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct ExtensionType {}

Expand Down
4 changes: 2 additions & 2 deletions xsd-parser/tests/enumeration/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(PartialEq, Debug, Clone, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub enum FooType {
#[yaserde(rename = "OFF")]
Expand All @@ -18,7 +18,7 @@ impl Default for FooType {
impl Validate for FooType {}


#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
pub struct FooType2(pub String);

impl Validate for FooType2 {}
Expand Down
4 changes: 2 additions & 2 deletions xsd-parser/tests/extension_base/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct BarType {
#[yaserde(prefix = "tns", rename = "b")]
Expand All @@ -10,7 +10,7 @@ pub struct BarType {

impl Validate for BarType {}

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct FooType {
#[yaserde(prefix = "tns", rename = "a")]
Expand Down
6 changes: 3 additions & 3 deletions xsd-parser/tests/extension_base_multilayer/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct BarType {
#[yaserde(prefix = "tns", rename = "aa")]
Expand All @@ -10,7 +10,7 @@ pub struct BarType {

impl Validate for BarType {}

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct FooType {
#[yaserde(prefix = "tns", rename = "Messages")]
Expand All @@ -22,7 +22,7 @@ impl Validate for FooType {}
pub mod foo_type {
use super::*;

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct MessagesType {
#[yaserde(prefix = "tns", rename = "a")]
Expand Down
2 changes: 1 addition & 1 deletion xsd-parser/tests/extension_base_two_files/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(
prefix = "tns",
namespace = "tns: http://example.com",
Expand Down
4 changes: 2 additions & 2 deletions xsd-parser/tests/ref_to_attribute/expected.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
pub struct Id(pub String);

impl Validate for Id {}
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct FooType {
#[yaserde(attribute, prefix = "tns", rename = "id")]
Expand Down
2 changes: 1 addition & 1 deletion xsd-parser/tests/rename_only_where_needed/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct FooType {
#[yaserde(prefix = "tns")]
Expand Down
2 changes: 1 addition & 1 deletion xsd-parser/tests/restriction_any_type/expected.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// pub type AppSequence = AppSequenceType;
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://schemas.xmlsoap.org/ws/2005/04/discovery")]
pub struct AppSequenceType {
#[yaserde(attribute, rename = "InstanceId")]
Expand Down
2 changes: 1 addition & 1 deletion xsd-parser/tests/simple_type/expected.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
pub struct FooType (pub String);
2 changes: 1 addition & 1 deletion xsd-parser/tests/tuple_with_integer/expected.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
pub struct FooType (pub Integer);
2 changes: 1 addition & 1 deletion xsd-parser/tests/tuple_with_string/expected.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
pub struct FooType(pub String);
2 changes: 1 addition & 1 deletion xsd-parser/tests/tuple_with_vec/expected.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
pub struct FooType(pub Vec<i32>);
6 changes: 3 additions & 3 deletions xsd-parser/tests/type_name_clash/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct BarType {
#[yaserde(attribute, rename = "a")]
Expand All @@ -8,7 +8,7 @@ pub struct BarType {
impl Validate for BarType {}


#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct FooType {
#[yaserde(prefix = "tns", rename = "Bar")]
Expand All @@ -20,7 +20,7 @@ impl Validate for FooType {}
pub mod foo_type {
use super::*;

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct BarType {
#[yaserde(attribute, rename = "b")]
Expand Down
2 changes: 1 addition & 1 deletion xsd-parser/tests/xsd_string/expected.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct FooType {
#[yaserde(prefix = "tns", rename = "Text")]
Expand Down

0 comments on commit 075f6b0

Please sign in to comment.