Skip to content

Commit

Permalink
Merge pull request #5 from goddtriffin/bump-version
Browse files Browse the repository at this point in the history
Bump minor version. Add unit tests for new <W: Write> functionality.
  • Loading branch information
goddtriffin authored Nov 8, 2022
2 parents 7a8a3a8 + 86c4239 commit 21ed866
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv = "1.63.0"
msrv = "1.65.0"
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "sitemap-rs"
version = "0.1.2"
version = "0.2.0"
edition = "2021"
rust-version = "1.63"
rust-version = "1.65"
authors = ["Todd Everett Griffin <[email protected]>"]
repository = "https://github.com/goddtriffin/sitemap-rs"
homepage = "https://www.toddgriffin.me/"
Expand All @@ -16,5 +16,5 @@ exclude = [
]

[dependencies]
xml-builder = "0.5.0"
xml-builder = "0.5.1"
chrono = "0.4.22"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ This library **cannot** parse sitemaps of any kind (yet! - pull requests welcome

**Project is under active maintenance - even if there are no recent commits! Please submit an issue / bug request if the library needs updating for any reason!**

Built with: `Rust 1.63`
Built with: `Rust 1.65`

### Feature Requests

Expand Down
13 changes: 13 additions & 0 deletions tests/sitemap_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,16 @@ fn test_constructor_too_many_sitemaps() {
},
}
}

#[test]
fn test_write() {
let sitemaps: Vec<Sitemap> = vec![Sitemap::new(
String::from("https://www.toddgriffin.me/sitemap.xml"),
None,
)];

let sitemap_index: SitemapIndex = SitemapIndex::new(sitemaps).unwrap();

let mut buf = Vec::<u8>::new();
sitemap_index.write(&mut buf).unwrap();
}
12 changes: 12 additions & 0 deletions tests/url_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,15 @@ fn test_constructor_too_much_news() {
},
}
}

#[test]
fn test_write() {
let urls: Vec<Url> = vec![Url::builder(String::from("https://www.toddgriffin.me/"))
.build()
.expect("failed a <url> validation")];

let url_set: UrlSet = UrlSet::new(urls).unwrap();

let mut buf = Vec::<u8>::new();
url_set.write(&mut buf).unwrap();
}

0 comments on commit 21ed866

Please sign in to comment.