from pathlib import Path
root=Path(__file__).resolve().parents[1]
compose=(root/"src/com/lemenzo/multisms/ComposeActivity.java").read_text()
calc=(root/"src/com/lemenzo/multisms/SmsLengthCalculator.java").read_text()
ui=(root/"src/com/lemenzo/multisms/Ui.java").read_text()
main=(root/"src/com/lemenzo/multisms/MainActivity.java").read_text()
checks={
"Android SmsMessage.calculateLength is source of truth":"SmsMessage.calculateLength(text, false)" in calc,
"encoding is read from calculateLength":"length[3]" in calc,
"visible Unicode character count uses code points":"codePointCount" in calc,
"Unicode single SMS capacity documented as 70":"return isUnicode() ? 70 : 160" in calc,
"concatenated Unicode capacity documented as 67":"return isUnicode() ? 67 : 153" in calc,
"personalize greeting removed":"personalize" not in compose.lower(),
"Compose uses calculator":"SmsLengthCalculator.calculate(text)" in compose,
"brand header uses launcher logo":"R.drawable.ic_launcher" in ui and "R.string.app_name" in ui,
"Main shows brand header":"Ui.brandHeader(this)" in main,
"Compose shows brand header":"Ui.brandHeader(this)" in compose,
"private-delivery description present":"private_delivery_description" in compose,
"modern usage card present":"sms_usage_title" in compose and "Ui.softCard(this)" in compose,
}
bad=[k for k,v in checks.items() if not v]
if bad:
 print("SMS LENGTH / MODERN UI VALIDATION: FAIL")
 for x in bad: print("-",x)
 raise SystemExit(1)
print("SMS LENGTH / MODERN UI VALIDATION: PASS")
for x in checks: print("-",x)
