#!/usr/bin/env python3 """Standalone synthetic fixture; standard library only. No network, credentials or user paths.""" import json, math, statistics, sys, platform, datetime import hashlib lf=b'alpha\nbeta\n';crlf=b'alpha\r\nbeta\r\n';noend=b'alpha\nbeta';trailing=b'alpha \nbeta\n' def normalize(b):return b.replace(b'\r\n',b'\n') def digest(b):return hashlib.sha256(b).hexdigest() result={'inputsHex':{'lf':lf.hex(),'crlf':crlf.hex(),'missingFinalNewline':noend.hex(),'trailingSpace':trailing.hex()},'rawBytes':{'lf':len(lf),'crlf':len(crlf)},'rawHashEqual':digest(lf)==digest(crlf),'normalizedHashEqual':digest(normalize(lf))==digest(normalize(crlf)),'missingFinalNewlineStillDifferent':normalize(lf)!=normalize(noend),'trailingSpaceStillDifferent':normalize(lf)!=normalize(trailing),'bareCRPreserved':normalize(b'a\rb')==b'a\rb','utf8BomPreserved':normalize(b'\xef\xbb\xbfa\r\n')==b'\xef\xbb\xbfa\n','allWhitespaceStripWronglyEqual':lf.split()==trailing.split()} assert result['rawBytes']=={'lf':11,'crlf':13} and not result['rawHashEqual'] and result['normalizedHashEqual'] print(json.dumps({"fixtureCreatedOn":"2026-10-15","executedAt":datetime.datetime.now(datetime.timezone.utc).isoformat(),"synthetic":True,"runtime":platform.python_version(),"result":result},ensure_ascii=False,indent=2))