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

Added additional tests to cover other folder names in regards to
[#10193](https://github.com/zed-industries/zed/issues/10193) and
[#9729](https://github.com/zed-industries/zed/issues/9729).

I had a similar issue but with folder names like '2.5' and '2.5_backup'.
I didn't see test coverage for those kinds of file names, so wanted to
add them.

![2024-04-10 09 07
03](https://github.com/zed-industries/zed/assets/127535196/eef26ce2-b0c7-4b1f-98ed-426ce1df0af2)

Release Notes:

- N/A

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This commit is contained in:
Jonathan Green 2024-04-10 18:47:53 -04:00 committed by GitHub
parent fd3ee5a9d0
commit b0eda77d73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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]