components
All repositories: gitoria
1.3 KB
#!/usr/bin/env python3# tests/same-output-compare.py (components mission 002): compare two tests/same-output.mjs runs. Masks only what changes per run / per code hash: ?v= hashes, source positions# (file.hl:L:C), the seed time, upload names (time-random), the hl-shell cache name. python3 compare.py A B [-v]import os, re, sys, diffliba, b = sys.argv[1], sys.argv[2]; v = '-v' in sys.argvdef mask(t):t = re.sub(r'\?v=[0-9a-f]+', '?v=H', t)t = re.sub(r'(\w[\w./-]*\.hl):\d+:\d+', r'\1:L:C', t)t = re.sub(r'@\d+:\d+', '@L:C', t)t = re.sub(r'hl-shell-[0-9a-f]+', 'hl-shell-H', t)t = re.sub(r'/md-editor/files/\d+-[0-9a-f]+', '/md-editor/files/T-R', t)t = re.sub(r'\b1[78]\d{11}\b', 'TIME', t)t = re.sub(r'("version"|"build"|"seed"|"now")\s*:\s*"?[\w.-]+"?', r'\1:X', t)return tfa, fb = sorted(os.listdir(a)), sorted(os.listdir(b))same = diff = 0for f in sorted(set(fa) | set(fb)):if f not in fa or f not in fb: print('ONLY IN', 'A' if f in fa else 'B', f); diff += 1; continuex, y = mask(open(os.path.join(a, f), errors='replace').read()), mask(open(os.path.join(b, f), errors='replace').read())if x == y: same += 1; continuediff += 1; print('DIFF', f)if v:for l in list(difflib.unified_diff(re.split(r'(?<=[;,}>\n])', x), re.split(r'(?<=[;,}>\n])', y), lineterm='', n=0))[2:40]: print(' ', l[:300])print(f'same {same}, different {diff}')
Branches
Latest commits
- c7e14cabRecord IC28 rerun and unchanged-main baseline comparisonmre
- 5e090ffdRecord IC28 review evidence and gate resultsmre
- adfe2c4dAdd shuffle, repeat and repeatOne shared iconsmre
- c96709c8media-player: skip = false and repeat = 'one' options (jukebox#19)mre
- bd4aa808Record VL24 deployment and live verificationmre
- e5b98ecfRun virtual-list gate before deploymentmre
- 2e9b4a8evirtual-list: into main, with centerId and scrollTop/onScroll (jukebox#20)mre
- 69954249Align all plugin sources with Hybriel day38bmre
- f740f666Re-vendor components to Hybriel set day38bmre
- 8176eb14Record CS23b deployment and live verificationmre
- 84e3ddaaRemove blank line before pagination Style closing bracemre
- a92298ddRecord exact CSS and same-date proof after specificity reviewmre
- c71a0abePreserve consumer theme specificity with nested tag rulesmre
- 64a2bc27Document CS23b style formatting proof and review statusmre
- a72b57cficons: nest Style rules in the language's formmre
- 927616e2pagination: nest Style rules in the language's formmre
- aab8ad29code-editor: nest Style rules in the language's formmre
- ba30727afile-upload: nest Style rules in the language's formmre
- 42fefa4emodal: nest Style rules in the language's formmre
- 6fd953e3range-picker: nest Style rules in the language's formmre