Squash Odysseus development history

This commit is contained in:
pewdiepie-archdaemon
2026-09-11 06:04:19 +00:00
parent e5c99a5eee
commit 6ee6502010
2050 changed files with 538359 additions and 57745 deletions
+18
View File
@@ -0,0 +1,18 @@
"""Regression: document_actions title/content helpers must tolerate non-strings.
_norm_title/_content_fingerprint/_real_len used `(x or "")`, which only guards
falsy; a non-string (e.g. an int) is truthy, so `.strip()`/`re.sub(..., x)`
raised. They now coerce non-strings to "".
"""
from src.document_actions import _norm_title, _content_fingerprint, _real_len
def test_non_string_inputs_do_not_crash():
assert _norm_title(123) == ""
assert _content_fingerprint(123) == ""
assert _real_len(["x"]) == 0
def test_valid_inputs_unchanged():
assert _norm_title(" Hello World ") == "hello world"
assert _real_len("# Title") == len("Title")