mirror of
https://github.com/dotnet/skills.git
synced 2026-09-20 09:49:54 +08:00
5a06b20cc9
* Support classic .NET test projects Teach dotnet-test skills and agents to preserve non-SDK projects, packages.config dependencies, explicit compile registration, legacy runners, and version-compatible MSTest APIs. Add regression evals for generation, execution, coverage, and authoring. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: fdfec89f-b610-479c-a6c7-c2936b300e68 * Address classic test fixture review Tighten the MSTest version grader, make the runner fixture assertion behavioral, and use nameof for the guarded parameter. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: fdfec89f-b610-479c-a6c7-c2936b300e68 --------- Copilot-Session: fdfec89f-b610-479c-a6c7-c2936b300e68
16 lines
367 B
Python
16 lines
367 B
Python
from __future__ import annotations
|
|
|
|
import re
|
|
|
|
|
|
def slugify(value: str, max_length: int = 48) -> str:
|
|
if max_length <= 0:
|
|
raise ValueError("max_length must be positive")
|
|
|
|
slug = re.sub(r"[^a-z0-9]+", "-", value.lower()).strip("-")
|
|
if len(slug) <= max_length:
|
|
return slug
|
|
|
|
shortened = slug[:max_length].rstrip("-")
|
|
return shortened
|