diff options
Diffstat (limited to 'spike/settings/test-strings/make_test_strings.py')
| -rw-r--r-- | spike/settings/test-strings/make_test_strings.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spike/settings/test-strings/make_test_strings.py b/spike/settings/test-strings/make_test_strings.py index 8d43977..9632220 100644 --- a/spike/settings/test-strings/make_test_strings.py +++ b/spike/settings/test-strings/make_test_strings.py @@ -14,6 +14,11 @@ used, so the length tests don't also test character handling. special.txt holds the characters that may be rejected (& < > \\ " { } %), non-ASCII text, a fake otpauth URI and a JSON fragment. +The phone refused to save special.txt (spike run 2026-10-21), so the c-*.txt +strings split it into one character group each, and aegis-json.txt is a +complete fake unencrypted Aegis export: together they show which characters +block saving and whether an Aegis file can be pasted at all. + Usage: python3 make_test_strings.py (writes into its own folder) """ @@ -28,6 +33,23 @@ SPECIAL = ( "otpauth://totp/Fake:alice?secret=JBSWY3DPEHPK3PXP&issuer=Fake&digits=6 | " '{"name":"Fake","path":"a\\/b"} END' ) +# Test C, split: (file name, label, string). Each ends with " END". +SPLIT = ( + ("c-1-percent", "C1: percent", "C1 % 100% END"), + ("c-2-angle", "C2: angle brackets", "C2 < > <b> END"), + ("c-3-backslash", "C3: backslash", "C3 \\ a\\/b END"), + ("c-4-quote", "C4: double quote", 'C4 " "x" END'), + ("c-5-braces", "C5: braces", "C5 { } {x} END"), + ("c-6-latin", "C6: accented letters and euro sign", "C6 äöü ß € END"), + ("c-7-emoji", "C7: emoji", "C7 😀 END"), + ("c-8-json", "C8: JSON fragment", 'C8 {"name":"Fake","n":1} END'), +) +AEGIS_JSON = ( + '{"version":1,"header":{"slots":null,"params":null},"db":{"version":3,"entries":[' + '{"type":"totp","uuid":"00000000-0000-4000-8000-000000000001","name":"alice@example.com",' + '"issuer":"TestOne","note":"","icon":null,"info":{"secret":"JBSWY3DPEHPK3PXP",' + '"algo":"SHA1","digits":6,"period":30}}]}}' +) HEADER = ( "# Author: cirakg & claude ai\n# Summary: {summary}\n" "# Copy ONLY the last line (the test string) into a settings field.\n\n" @@ -55,6 +77,8 @@ def main() -> None: here = Path(__file__).resolve().parent entries = [(f"len-{n:04d}", f"{n} characters", marker_string(n)) for n in LENGTHS] entries.append(("special", "special characters", SPECIAL)) + entries.extend(SPLIT) + entries.append(("aegis-json", "fake unencrypted Aegis export", AEGIS_JSON)) for name, label, value in entries: (here / f"{name}.txt").write_text(HEADER.format(summary=f"Settings spike test string: {label}.") + value + "\n") cards = "\n".join( |
