wip: 2026-08-11 工作树快照(docs/memory/h5.py/scripts 等 447 项未评审改动,安全提交到 feat 分支)
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""QA: count target emoji in dist assets"""
|
||||
import sys
|
||||
|
||||
FILES = [
|
||||
r"D:\资料\03-项目开发\wecom_it_smart_desk\src\frontend-agent\dist\assets\index-C9eNZBP_.js",
|
||||
r"D:\资料\03-项目开发\wecom_it_smart_desk\src\frontend-agent\dist\assets\Workspace-C-lLbDyz.js",
|
||||
r"D:\资料\03-项目开发\wecom_it_smart_desk\src\frontend-agent\dist\assets\index-DAn-Mowv.css",
|
||||
]
|
||||
|
||||
EMOJIS = ["💡", "🎚️", "🖌️", "🔄", "✨", "🎭", "✏️"]
|
||||
|
||||
def main():
|
||||
totals = {e: 0 for e in EMOJIS}
|
||||
per_file = {}
|
||||
for f in FILES:
|
||||
try:
|
||||
with open(f, encoding="utf-8") as fh:
|
||||
data = fh.read()
|
||||
except Exception as ex:
|
||||
print("ERR", f, ex)
|
||||
continue
|
||||
per_file[f] = {}
|
||||
for e in EMOJIS:
|
||||
c = data.count(e)
|
||||
per_file[f][e] = c
|
||||
totals[e] += c
|
||||
print("FILE:", f.split("assets")[-1], "chars:", len(data))
|
||||
print(" ", {e: per_file[f][e] for e in EMOJIS})
|
||||
print("TOTAL:", totals)
|
||||
# assert engineer claims
|
||||
assert totals["💡"] == 4, f"💡 expected 4 got {totals['💡']}"
|
||||
assert totals["🎚️"] == 1, f"🎚️ expected 1 got {totals['🎚️']}"
|
||||
assert totals["🖌️"] == 2, f"🖌️ expected 2 got {totals['🖌️']}"
|
||||
assert totals["🔄"] == 7, f"🔄 expected 7 got {totals['🔄']}"
|
||||
assert totals["✨"] == 0, f"✨ expected 0 got {totals['✨']}"
|
||||
assert totals["🎭"] == 0, f"🎭 expected 0 got {totals['🎭']}"
|
||||
assert totals["✏️"] == 1, f"✏️ expected 1 got {totals['✏️']}"
|
||||
print("ALL EMOJI ASSERTIONS PASSED")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user