LanguageTag: Enables some commented out tests

pull/10/head
Tpt 6 years ago
parent b673471b39
commit 01f3074d1e
  1. 22
      lib/src/model/language_tag.rs

@ -1003,7 +1003,6 @@ fn test_broken_tags() {
"f-Latn", "f-Latn",
"fr-Latn-F", "fr-Latn-F",
"a-value", "a-value",
// "en-a-bbb-a-ccc", # 'a' appears twice, commented out because well-formed
"tlh-a-b-foo", "tlh-a-b-foo",
"i-notexist", // grandfathered but not registered: always invalid "i-notexist", // grandfathered but not registered: always invalid
"abcdefghi-012345678", "abcdefghi-012345678",
@ -1024,7 +1023,6 @@ fn test_broken_tags() {
"ab--ab", "ab--ab",
"ab-abc-", "ab-abc-",
"-ab-abc", "-ab-abc",
// "ab-c-abc-r-toto-c-abc # 'c' appears twice ", commented out because well-formed
"abcd-efg", "abcd-efg",
"aabbccddE", "aabbccddE",
]; ];
@ -1116,15 +1114,17 @@ fn test_valid_tags() {
#[test] #[test]
fn test_invalid_tags() { fn test_invalid_tags() {
let tags = vec![ let tags = vec![
//TODO "ax-TZ", // Not in the registry, but well-formed "en-a-bbb-a-ccc", // 'a' appears twice, moved from broken_tags
//TODO "fra-Latn", // ISO 639 can be 3-letters "ab-c-abc-r-toto-c-abc", // 'c' appears twice ", moved from broken_tags
//TODO "fra", //TODO "ax-TZ", // Not in the registry, but well-formed
//TODO "fra-FX", //TODO "fra-Latn", // ISO 639 can be 3-letters
//TODO "abcd-Latn", // Language of 4 chars reserved for future use //TODO "fra",
//TODO "AaBbCcDd-x-y-any-x", // Language of 5-8 chars, registered //TODO "fra-FX",
//TODO "zh-Latm-CN", // Typo //TODO "abcd-Latn", // Language of 4 chars reserved for future use
//TODO "de-DE-1902", // Wrong variant //TODO "AaBbCcDd-x-y-any-x", // Language of 5-8 chars, registered
//TODO "fr-shadok", // Variant //TODO "zh-Latm-CN", // Typo
//TODO "de-DE-1902", // Wrong variant
//TODO "fr-shadok", // Variant
]; ];
for tag in tags { for tag in tags {
let result = LanguageTag::from_str(tag); let result = LanguageTag::from_str(tag);

Loading…
Cancel
Save