From 1f10d846a34e045f00b1d13bd9ac701777df0d38 Mon Sep 17 00:00:00 2001 From: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Sun, 5 Nov 2023 19:21:00 +0800 Subject: [PATCH] Fix tests 1. for override test, test for something in `common` 2. move git mappings to `common` --- src/syntax_mapping.rs | 8 ++++---- .../{linux/50-git-config.toml => common/50-git.toml} | 0 2 files changed, 4 insertions(+), 4 deletions(-) rename src/syntax_mapping/builtins/{linux/50-git-config.toml => common/50-git.toml} (100%) diff --git a/src/syntax_mapping.rs b/src/syntax_mapping.rs index 2ad7df5f..442fb6dd 100644 --- a/src/syntax_mapping.rs +++ b/src/syntax_mapping.rs @@ -153,13 +153,13 @@ mod tests { let mut map = SyntaxMapping::new(); assert_eq!( - map.get_syntax_for("/etc/profile"), - Some(MappingTarget::MapTo("Bourne Again Shell (bash)")) + map.get_syntax_for("/path/to/httpd.conf"), + Some(MappingTarget::MapTo("Apache Conf")) ); - map.insert("/etc/profile", MappingTarget::MapTo("My Syntax")) + map.insert("httpd.conf", MappingTarget::MapTo("My Syntax")) .ok(); assert_eq!( - map.get_syntax_for("/etc/profile"), + map.get_syntax_for("/path/to/httpd.conf"), Some(MappingTarget::MapTo("My Syntax")) ); } diff --git a/src/syntax_mapping/builtins/linux/50-git-config.toml b/src/syntax_mapping/builtins/common/50-git.toml similarity index 100% rename from src/syntax_mapping/builtins/linux/50-git-config.toml rename to src/syntax_mapping/builtins/common/50-git.toml