Skip to content

Commit

Permalink
Fix panic on config file generation
Browse files Browse the repository at this point in the history
  • Loading branch information
czocher committed Jan 30, 2024
1 parent c3ee2ad commit e63d3c6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ pub struct ScalaParams {
#[serde(default)]
pub struct SwiftParams {
pub prefix: String,
pub type_mappings: HashMap<String, String>,
pub default_decorators: Vec<String>,
pub default_generic_constraints: Vec<String>,
pub type_mappings: HashMap<String, String>,
}

#[derive(Default, Serialize, Deserialize, PartialEq, Eq, Debug)]
Expand Down Expand Up @@ -122,6 +122,14 @@ mod test {
[CURRENT_DIR, TEST_DIR, filename].iter().collect()
}

#[test]
fn to_string_and_back() {
let path = config_file_path("mappings_config.toml");
let config = load_config(Some(path)).unwrap();

toml::from_str::<Config>(&toml::to_string_pretty(&config).unwrap()).unwrap();
}

#[test]
fn default_test() {
let path = config_file_path("default_config.toml");
Expand Down

0 comments on commit e63d3c6

Please sign in to comment.