Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Add a few tests to cover other folder names (#10356)

Jonathan Greenb0eda77d7385
diff --git a/crates/util/src/util.rs b/crates/util/src/util.rs
index 882e1d704ba..6202b91d849 100644
--- a/crates/util/src/util.rs
+++ b/crates/util/src/util.rs
@@ -641,6 +641,30 @@ mod tests {
NumericPrefixWithSuffix::from_numeric_prefixed_str(target),
Some(NumericPrefixWithSuffix(1, "_2ab"))
);
+
+ let target = "1.2";
+ assert_eq!(
+ NumericPrefixWithSuffix::from_numeric_prefixed_str(target),
+ Some(NumericPrefixWithSuffix(1, ".2"))
+ );
+
+ let target = "1.2_a";
+ assert_eq!(
+ NumericPrefixWithSuffix::from_numeric_prefixed_str(target),
+ Some(NumericPrefixWithSuffix(1, ".2_a"))
+ );
+
+ let target = "12.2_a";
+ assert_eq!(
+ NumericPrefixWithSuffix::from_numeric_prefixed_str(target),
+ Some(NumericPrefixWithSuffix(12, ".2_a"))
+ );
+
+ let target = "12a.2_a";
+ assert_eq!(
+ NumericPrefixWithSuffix::from_numeric_prefixed_str(target),
+ Some(NumericPrefixWithSuffix(12, "a.2_a"))
+ );
}
#[test]