From 8075f9e04f2d3d12536a7a98a885f174ff0aa891 Mon Sep 17 00:00:00 2001 From: Kiril Videlov Date: Fri, 22 Mar 2024 13:26:44 +0100 Subject: [PATCH] feat: Add tests for `normalize_branch_name` function --- gitbutler-app/src/virtual_branches/virtual.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gitbutler-app/src/virtual_branches/virtual.rs b/gitbutler-app/src/virtual_branches/virtual.rs index ab3dda80c..95c785376 100644 --- a/gitbutler-app/src/virtual_branches/virtual.rs +++ b/gitbutler-app/src/virtual_branches/virtual.rs @@ -3998,4 +3998,11 @@ mod tests { assert!(joined(10, 13, 13, 16)); assert!(!joined(10, 13, 14, 17)); } + + #[test] + fn test_normalize_branch_name() { + assert_eq!(normalize_branch_name("feature/branch"), "feature/branch"); + assert_eq!(normalize_branch_name("foo#branch"), "foo#branch"); + assert_eq!(normalize_branch_name("foo!branch"), "foo-branch"); + } }