Skip to content

Commit b541c32

Browse files
committed
tests(coverage): add tests for private only tags and comparison
1 parent 14ba67a commit b541c32

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/tests.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,23 @@ fn test_macro() {
197197
assert_eq!(c1, c2);
198198
}
199199

200+
#[test]
201+
fn test_private_tag() {
202+
let mut tag: LanguageTag = Default::default();
203+
tag.privateuse = vec!["foo".to_owned(), "bar".to_owned()];
204+
assert_eq!(format!("{}", tag), "x-foo-bar");
205+
}
206+
207+
#[test]
208+
fn test_eq() {
209+
let mut tag1: LanguageTag = Default::default();
210+
tag1.language = Some("zh".to_owned());
211+
let mut tag2: LanguageTag = Default::default();
212+
tag2.language = Some("zh".to_owned());
213+
tag2.script = Some("Latn".to_owned());
214+
assert!(tag1 != tag2);
215+
}
216+
200217
#[test]
201218
fn test_wellformed_tags() {
202219
// Source: http://www.langtag.net/test-suites/well-formed-tags.txt

0 commit comments

Comments
 (0)