Test new database error
This commit is contained in:
parent
8c8e6971c5
commit
1336c211f9
@ -67,7 +67,7 @@ mod tests {
|
|||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
use crate::{tests::COLLECTION, Artist, ArtistId, Format};
|
use crate::{tests::COLLECTION, Artist, ArtistId, Format, Collection};
|
||||||
|
|
||||||
fn artist_to_json(artist: &Artist) -> String {
|
fn artist_to_json(artist: &Artist) -> String {
|
||||||
let album_artist = &artist.id.name;
|
let album_artist = &artist.id.name;
|
||||||
@ -186,7 +186,18 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn errors() {
|
fn load_errors() {
|
||||||
|
let json = String::from("");
|
||||||
|
let serde_err = serde_json::from_str::<Collection>(&json);
|
||||||
|
assert!(serde_err.is_err());
|
||||||
|
|
||||||
|
let serde_err: LoadError = serde_err.unwrap_err().into();
|
||||||
|
assert!(!serde_err.to_string().is_empty());
|
||||||
|
assert!(!format!("{:?}", serde_err).is_empty());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn save_errors() {
|
||||||
let mut object = HashMap::<ArtistId, String>::new();
|
let mut object = HashMap::<ArtistId, String>::new();
|
||||||
object.insert(
|
object.insert(
|
||||||
ArtistId {
|
ArtistId {
|
||||||
|
Loading…
Reference in New Issue
Block a user