Skip to content

Commit

Permalink
Merge pull request #5 from Radiance-Platform/test
Browse files Browse the repository at this point in the history
Test
  • Loading branch information
YoshikoJanai authored Apr 28, 2022
2 parents 436fef4 + 46557ed commit 501dbdf
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/game/config_parsers/characters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn process_config_serde(characters: &mut HashMap<String, Character>, config_
get_character_from_data( characters, parsed);
}
Err(err) =>{
println!("{}", err);
eprintln!("{}", err);
}
}
Ok(())
Expand Down
4 changes: 2 additions & 2 deletions src/game/config_parsers/dialogs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ use crate::game::dialogs::Dialog;

pub fn process_config_serde(dialogs: &mut HashMap<String, Dialog>, config_path: &Path) -> Result<(), serde_yaml::Error>{
let file_contents = fs::read_to_string(config_path).unwrap();
let doc = serde_yaml::from_str::<Vec::<Dialog>>(&file_contents);
let doc = serde_yaml::from_str::<Vec<Dialog>>(&file_contents);
match doc {
Ok(parsed) =>{
for dialog in parsed {
dialogs.insert(dialog.id.clone(), dialog.clone());
}
}
Err(err) =>{
println!("{}", err);
eprintln!("{}", err);
}
}
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion src/game/config_parsers/maps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub fn process_config_serde(map_item_data: &mut Vec<MapItemData>, config_path: &
map_item_data.push(parsed);
}
Err(err) =>{
println!("{}",err);
eprintln!("{}",err);
}
}
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mod tests {
fn test_good_room() {
// This assert would fire and test will fail.
// Please note, that private functions can be tested too!
// let mut test_rooms = Vec::<MapItemData>::new();
//let mut test_rooms = Vec::<MapItemData>::new();
}

// Lets us use ? to return quicker when failing
Expand Down

0 comments on commit 501dbdf

Please sign in to comment.