mirror of
				https://github.com/sharkdp/bat.git
				synced 2025-11-04 00:51:56 +00:00 
			
		
		
		
	Add test: custom_mappings_precedence
				
					
				
			This commit is contained in:
		@@ -183,4 +183,18 @@ mod tests {
 | 
			
		||||
            Some(MappingTarget::MapTo("My Syntax"))
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #[test]
 | 
			
		||||
    fn custom_mappings_precedence() {
 | 
			
		||||
        let mut map = SyntaxMapping::new();
 | 
			
		||||
 | 
			
		||||
        map.insert("/path/to/foo", MappingTarget::MapTo("alpha"))
 | 
			
		||||
            .ok();
 | 
			
		||||
        map.insert("/path/to/foo", MappingTarget::MapTo("bravo"))
 | 
			
		||||
            .ok();
 | 
			
		||||
        assert_eq!(
 | 
			
		||||
            map.get_syntax_for("/path/to/foo"),
 | 
			
		||||
            Some(MappingTarget::MapTo("alpha"))
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user