55implementation matches the API for portable zip / download filenames.
66"""
77
8+ import os
9+
810from utils .slugify import slugify
911
1012
@@ -28,3 +30,31 @@ def test_empty_after_strip():
2830
2931def test_digits_preserved ():
3032 assert slugify ("Issue 42 Fix" ) == "issue-42-fix"
33+
34+
35+ def test_punctuation_examples_match_regex_behavior ():
36+ assert slugify ("AT&T" ) == "at-t"
37+ assert slugify ("issue#42" ) == "issue-42"
38+
39+
40+ def test_default_used_when_slug_empty ():
41+ assert slugify ("!!!" , default = "session" ) == "session"
42+ assert slugify ("!!!" ) == ""
43+
44+
45+ def test_export_leaf_path_parity_api_zip_vs_cli ():
46+ """Same session inputs → same ``proj_slug``, ``title_slug``, and file leaf as API vs CLI."""
47+ title = "Issue #42: AT&T"
48+ project = "Foo/Bar!"
49+ sid = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
50+ ts_file = "2026-05-07T12-00-00"
51+ short_id = sid [:8 ]
52+ title_slug = slugify (title , default = "session" )
53+ proj_slug = slugify (project , default = "project" )
54+ leaf_md = f"{ ts_file } __{ title_slug } __{ short_id } .md"
55+ api_zip_inner = f"{ proj_slug } /{ leaf_md } "
56+ date_str = ts_file [:10 ]
57+ cli_rel = os .path .join (date_str , proj_slug , leaf_md )
58+ assert api_zip_inner .endswith (leaf_md )
59+ assert os .path .basename (cli_rel ) == leaf_md
60+ assert cli_rel .replace ("\\ " , "/" ).endswith (f"{ proj_slug } /{ leaf_md } " )
0 commit comments