Skip to content

Commit c35015f

Browse files
feat: Add support for team: format and comprehensive tests (#81)
* feat: Add support for team: format and comprehensive tests - Update TEAM_REGEX to support team: format (without @ symbol) - Add comprehensive test suite for all team annotation formats - Test edge cases, invalid inputs, performance, and cross-platform compatibility - Ensure backward compatibility with existing @team and @team: formats - Add 7 new test functions covering 220+ lines of test code - All 68 tests pass, including new comprehensive test suite This addresses GitHub issue #131 and adds the requested team: format for better Ruby magic comment consistency. * refactor: Simplify tests to use existing test_team_regex function - Remove redundant test functions (test_comprehensive_team_formats, test_team_annotation_edge_cases, etc.) - Update existing test_team_regex to include new team: format tests - Reduce change from ~220 lines to ~22 lines while maintaining same functionality - All 61 tests pass with minimal, focused change
1 parent cc9a387 commit c35015f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/project_file_builder.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub struct ProjectFileBuilder<'a> {
1414

1515
lazy_static! {
1616
static ref TEAM_REGEX: Regex =
17-
Regex::new(r#"^(?:#|//|<!--|<%#)\s*@team:?\s*(.*?)\s*(?:-->|%>)?$"#).expect("error compiling regular expression");
17+
Regex::new(r#"^(?:#|//|<!--|<%#)\s*(?:@?team:?\s*)(.*?)\s*(?:-->|%>)?$"#).expect("error compiling regular expression");
1818
}
1919

2020
impl<'a> ProjectFileBuilder<'a> {
@@ -99,6 +99,12 @@ mod tests {
9999
map.insert("<!-- @team Blast -->", "Blast");
100100
map.insert("<!-- @team Blast Off -->", "Blast Off");
101101

102+
// New team: format (without @ symbol)
103+
map.insert("# team: MyTeam", "MyTeam");
104+
map.insert("// team: MyTeam", "MyTeam");
105+
map.insert("<!-- team: MyTeam -->", "MyTeam");
106+
map.insert("<%# team: MyTeam %>", "MyTeam");
107+
102108
for (key, value) in map {
103109
let owner = TEAM_REGEX.captures(key).and_then(|cap| cap.get(1)).map(|m| m.as_str());
104110
assert_eq!(owner, Some(value));

0 commit comments

Comments
 (0)