mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 03:32:15 +00:00
xml: Rename XmlRoot to XmlRootTag
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
use rustical_xml::de::XmlDocument;
|
||||
use rustical_xml::XmlRoot;
|
||||
use rustical_xml::XmlRootTag;
|
||||
use rustical_xml::{Unit, Unparsed, XmlDeserialize};
|
||||
use std::collections::HashSet;
|
||||
|
||||
#[test]
|
||||
fn test_struct_text_field() {
|
||||
#[derive(Debug, XmlDeserialize, XmlRoot, PartialEq)]
|
||||
#[derive(Debug, XmlDeserialize, XmlRootTag, PartialEq)]
|
||||
#[xml(root = b"document")]
|
||||
struct Document {
|
||||
#[xml(ty = "text")]
|
||||
@@ -26,7 +26,7 @@ fn test_struct_text_field() {
|
||||
|
||||
#[test]
|
||||
fn test_struct_document() {
|
||||
#[derive(Debug, XmlDeserialize, XmlRoot, PartialEq)]
|
||||
#[derive(Debug, XmlDeserialize, XmlRootTag, PartialEq)]
|
||||
#[xml(root = b"document")]
|
||||
struct Document {
|
||||
child: Child,
|
||||
@@ -51,7 +51,7 @@ fn test_struct_document() {
|
||||
|
||||
#[test]
|
||||
fn test_struct_rename_field() {
|
||||
#[derive(Debug, XmlDeserialize, XmlRoot, PartialEq)]
|
||||
#[derive(Debug, XmlDeserialize, XmlRootTag, PartialEq)]
|
||||
#[xml(root = b"document")]
|
||||
struct Document {
|
||||
#[xml(rename = b"ok-wow")]
|
||||
@@ -77,7 +77,7 @@ fn test_struct_rename_field() {
|
||||
|
||||
#[test]
|
||||
fn test_struct_optional_field() {
|
||||
#[derive(Debug, XmlDeserialize, XmlRoot, PartialEq)]
|
||||
#[derive(Debug, XmlDeserialize, XmlRootTag, PartialEq)]
|
||||
#[xml(root = b"document")]
|
||||
struct Document {
|
||||
#[xml(default = "Default::default")]
|
||||
@@ -96,7 +96,7 @@ fn test_struct_optional_field() {
|
||||
|
||||
#[test]
|
||||
fn test_struct_vec() {
|
||||
#[derive(Debug, XmlDeserialize, XmlRoot, PartialEq)]
|
||||
#[derive(Debug, XmlDeserialize, XmlRootTag, PartialEq)]
|
||||
#[xml(root = b"document")]
|
||||
struct Document {
|
||||
#[xml(rename = b"child", flatten)]
|
||||
@@ -124,7 +124,7 @@ fn test_struct_vec() {
|
||||
|
||||
#[test]
|
||||
fn test_struct_set() {
|
||||
#[derive(Debug, XmlDeserialize, XmlRoot, PartialEq)]
|
||||
#[derive(Debug, XmlDeserialize, XmlRootTag, PartialEq)]
|
||||
#[xml(root = b"document")]
|
||||
struct Document {
|
||||
#[xml(rename = b"child", flatten)]
|
||||
@@ -152,7 +152,7 @@ fn test_struct_set() {
|
||||
|
||||
#[test]
|
||||
fn test_struct_ns() {
|
||||
#[derive(Debug, XmlDeserialize, XmlRoot, PartialEq)]
|
||||
#[derive(Debug, XmlDeserialize, XmlRootTag, PartialEq)]
|
||||
#[xml(root = b"document", ns_strict)]
|
||||
struct Document {
|
||||
#[xml(ns = b"hello")]
|
||||
@@ -165,7 +165,7 @@ fn test_struct_ns() {
|
||||
|
||||
#[test]
|
||||
fn test_struct_attr() {
|
||||
#[derive(Debug, XmlDeserialize, XmlRoot, PartialEq)]
|
||||
#[derive(Debug, XmlDeserialize, XmlRootTag, PartialEq)]
|
||||
#[xml(root = b"document", ns_strict)]
|
||||
struct Document {
|
||||
#[xml(ns = b"hello")]
|
||||
@@ -192,7 +192,7 @@ fn test_struct_attr() {
|
||||
|
||||
#[test]
|
||||
fn test_struct_generics() {
|
||||
#[derive(XmlDeserialize, XmlRoot)]
|
||||
#[derive(XmlDeserialize, XmlRootTag)]
|
||||
#[xml(root = b"document", ns_strict)]
|
||||
struct Document<T: XmlDeserialize> {
|
||||
child: T,
|
||||
@@ -212,7 +212,7 @@ fn test_struct_generics() {
|
||||
|
||||
#[test]
|
||||
fn test_struct_unparsed() {
|
||||
#[derive(XmlDeserialize, XmlRoot)]
|
||||
#[derive(XmlDeserialize, XmlRootTag)]
|
||||
#[xml(root = b"document", ns_strict)]
|
||||
struct Document {
|
||||
child: Unparsed,
|
||||
|
||||
Reference in New Issue
Block a user