diff options
author | sharkdp <davidpeter@web.de> | 2020-03-22 10:37:35 +0100 |
---|---|---|
committer | David Peter <sharkdp@users.noreply.github.com> | 2020-03-22 11:02:51 +0100 |
commit | dfd3ef022ec68195a47b2f76ef683125b8d46d44 (patch) | |
tree | 2c204806b01d5f066ddafe8c446a096df997114e /src/assets.rs | |
parent | 978def2d40914a83e245fdbb82b8b1ba9fcf81b5 (diff) |
Add more default mappings, reverse traversal
Diffstat (limited to 'src/assets.rs')
-rw-r--r-- | src/assets.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/assets.rs b/src/assets.rs index 4d4bd184..23f82344 100644 --- a/src/assets.rs +++ b/src/assets.rs @@ -285,6 +285,7 @@ mod tests { fn syntax_detection_well_defined_mapping_for_duplicate_extensions() { let test = SyntaxDetectionTest::new(); + assert_eq!(test.syntax_name("test.h"), "C++"); assert_eq!(test.syntax_name("test.sass"), "Sass"); assert_eq!(test.syntax_name("test.hs"), "Haskell (improved)"); assert_eq!(test.syntax_name("test.js"), "JavaScript (Babel)"); @@ -309,11 +310,11 @@ mod tests { fn syntax_detection_with_custom_mapping() { let mut test = SyntaxDetectionTest::new(); - assert_ne!(test.syntax_name("test.h"), "C++"); + assert_eq!(test.syntax_name("test.h"), "C++"); test.syntax_mapping - .insert("*.h", MappingTarget::MapTo("C++")) + .insert("*.h", MappingTarget::MapTo("C")) .ok(); - assert_eq!(test.syntax_name("test.h"), "C++"); + assert_eq!(test.syntax_name("test.h"), "C"); } #[test] |