Skip to content

Commit

Permalink
Rust likely_subtags: categorize"minimizeFavorRegion" as "unsupported" (
Browse files Browse the repository at this point in the history
…#114)

* Rust number format: mark scientific as unsupported

* Reformat numberfmt.rs

* ICU4X: move 'minimizeFavorRegion' requests to 'unsupported'

* Format rust source
  • Loading branch information
sven-oly authored Oct 18, 2023
1 parent 2f9c0ab commit ccbff3d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
10 changes: 10 additions & 0 deletions executors/rust/src/likelysubtags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ pub fn run_likelysubtags_test(json_obj: &Value) -> Result<Value, String> {

let mut locale = Locale::from_str(locale_str).unwrap();

if test_option == &"minimizeFavorRegion" {
// This option is not yet supported.
return Ok(json!({
"label": label,
"error_detail": {"option": test_option},
"unsupported": "minimizeFavorRegion",
"error_type": "unsupported",
}));
}

if test_option == &"minimize" {
lc.minimize(&mut locale);
} else if test_option == &"maximize" {
Expand Down
4 changes: 2 additions & 2 deletions schema/check_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ def main(args):
"error_info": str(err)
})
if not result:
schema_errors.append([schema_file_path, result, err, file_path])
logging.error('Bad Schema at %s', schema_file_path)
schema_errors.append([schema_file, result, err, file_path])
logging.error('Bad Schema at %s', schema_file)
schema_count += 1

ok = val_schema.save_schema_validation_summary(validation_status)
Expand Down
18 changes: 17 additions & 1 deletion schema/likely_subtags/result_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,27 @@
"error_message": {
"description": "What went wrong",
"type": "string"
},
"error_detail": {
"description": "more information on the failure",
"type": "object",
"properties": {
"option": {
"description": "Parameters causing the failure",
"type": "string",
"enum": ["minimizeFavorRegion"]
}
}
},
"error_type": {
"description": "",
"type": "string",
"enum": ["unsupported"]
}
},
"required": [
"label"
]
]
}
}
}
Expand Down

0 comments on commit ccbff3d

Please sign in to comment.