跨端: 变异体计数收进仓库 —— 前面报过 40/48/58 四个数,根因是"job 集合"从没定义
pi 用 `/tmp/mut/` 复算后指出:48 也不对。他是对的,而且**不是记性问题、是口径问题**——
我把 9 个 `jobs*.json` 的条目**直接相加**,没做归一:同一个变异体在跨批重锚时被键了多次
(13 组重复、15 条冗余),最典型的是「计划不搬运模糊值」同时挂在 `jobs-b3`/`jobs-blur`/`jobs-blur2`
三个文件、三个不同 `test` 键上 —— 于是"按判据文件分组求和"必然把它算三次,
而"跑在新增判据上的是多少"在交叉归类下**没有唯一答案**(41 或 35)。
更根本的是 pi 指出的第二层:**那个统计脚本根本不在 `/tmp/mut/` 里**(他为了复算是现写的),
而且 `/tmp` 会被清、不在仓库里 ⇒ 变异体数字**只活在信里**。
这一路已经立过同形状的规则(余额打在 `RESULT` 行、权威源在文件里),这条当时漏了。
## 做了什么
- `client/electron/test/mutants/`:把 `mut.py`、`run.sh`、`jobs*.json`、`baseline.sha`
从 `/tmp` 挪进仓库(`/tmp` 会清、复核方够不着)。
- `mutants/summary.py`:**口径的唯一权威**,定义写死在代码里:
· 不同变异体 = 按 (file, pat, repl) 去重(`retired` 不计);
· 跑起来 = 锚点在该文件里**恰好命中 1 次**(与 mut.py 同一条件);
· `on_new_criteria` = 该变异体的**每一个** test 键都指向本批新增的两个判据文件
(口径 A —— 不因交叉归类虚高;另报口径 B 作参考,它只增不减,不拿来报数)。
- `run-all.mjs` 的 `RESULT` 行播报它,并**顺带自证基线**:跑不起 `summary.py` 时
**不静默**(打印 status 与 stderr 末行)——我第一版路径写错,只看到"计数未知",
真因(`can't open file …/test/test/mutants/summary.py`)被吞掉了。
- `mutants/test-keys.json`:`test` 键 → 判据文件的**唯一来源**(`mut.py` 与 `summary.py`
共用)。此前两处各写一份,分叉过一次:键名从旧名换成 API 名后 `summary.py` 那份没跟上,
于是所有锚点被判 `hits=-1`、报出"51 个变异体全部 skipped"。
- 无歧义口径下的**当前真值**:`mutants=48 ran=48 skipped=0 on_new_criteria=36 baseline=7/7✓`
(口径 B = 41;原始条目 66,其中 `retired` 5)。
- 清掉 pi 指出的三类脏数据:
· **过期条目**(锚点是修复前的旧写法,`hits=0`)标 `retired` 5 条 ——
它们**不是"没跑成的变异体"**,重锚后都跑过、都红了;留着只会把 skipped 一直抬高;
· **重复计数**(multipart 那条在两个文件里各一次)去重;
· **真 skip** 的 multipart 锚点切片成 `name: 'file',\n contentType: mimeType` ⇒ 真的跑起来了
(此前命中 2 次,因为 `ApiClient.ets` 有两个 multipart 构造器)。
- 修两处并发/竞争:`mut.py` 的 `tempfile.mktemp()`(Py3 起 deprecated,**TOCTOU**)→ `mkstemp`;
`run.sh` 的固定 `/tmp/mut/bak` → 按 `$$-$RANDOM` 唯一(并行跑会互相覆盖备份)。
## 未做(如实说)
- **`AdminUsersPage.ets` 有一处不是我做的改动留在工作树里**(11:20:48,我 11:21 的提交之后):
`Chip(text, bg, fg: string)` → `ResourceColor`。核实过是**正确的 ArkTS 修法**
(`Theme.surfaceMuted`/`textSubtle` 是 `Resource`、`chipNeutralBg` 是 `string`,
第 368 行的三目因此是 `Resource | string` ⇒ 旧签名**编译不过**)。
我**没有提交也没有回退**它 —— 工作树是共享的,不该替别人提交别人的活。
基线因此重算了(`baseline.sha` 顶部记了原因与哈希来源,重算本身是**有意动作**:
随手重算会把"某次变异没还原"永久掩盖掉)。
- Go 侧 `debt_registry_test.go` 仍未跑(沙箱无 Go 模块缓存),只做了 `gofmt`。
This commit is contained in:
233
client/electron/test/mutants/jobs/jobs-all.json
Normal file
233
client/electron/test/mutants/jobs/jobs-all.json
Normal file
@ -0,0 +1,233 @@
|
||||
[
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/model/AdminUsers.ts",
|
||||
"pat": "return role === 'admin';",
|
||||
"repl": "return role !== undefined && role.trim().toLowerCase() === 'admin';",
|
||||
"test": "admin",
|
||||
"why": "角色判定放宽"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/model/AdminUsers.ts",
|
||||
"pat": " if \\(!found\\) \\{\n out\\.push\\(item\\);\n \\}\n return out;",
|
||||
"repl": " if (!found) {\n list.push(item);\n }\n return list;",
|
||||
"test": "admin",
|
||||
"why": "toggled 就地改入参"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/model/AdminUsers.ts",
|
||||
"pat": "if \\(v === undefined \\|\\| v\\.length === 0\\) \\{",
|
||||
"repl": "if (v === undefined) {",
|
||||
"test": "admin",
|
||||
"why": "空串不当从未登录"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/model/AdminUsers.ts",
|
||||
"pat": " if \\(user\\.role === 'admin'\\) \\{\n return false;\n \\}\n",
|
||||
"repl": "",
|
||||
"test": "admin",
|
||||
"why": "管理员也打受限徽标"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/model/AdminUsers.ts",
|
||||
"pat": "return '操作失败(服务端没有给原因)';",
|
||||
"repl": "return '操作失败';",
|
||||
"test": "admin",
|
||||
"why": "兜底句不说原因缺席"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/model/AdminUsers.ts",
|
||||
"pat": " return message;\n \\}\n if \\(!isApiError",
|
||||
"repl": " return '操作失败';\n }\n if (!isApiError",
|
||||
"test": "admin",
|
||||
"why": "吞掉服务端文案"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/model/ImagePrep.ts",
|
||||
"pat": "const longest: number = Math\\.max\\(width, height\\);",
|
||||
"repl": "const longest: number = width;",
|
||||
"test": "prep",
|
||||
"why": "缩放按宽算"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/model/ImagePrep.ts",
|
||||
"pat": "const scale: number = Math\\.min\\(1, maxEdge / longest\\);",
|
||||
"repl": "const scale: number = maxEdge / longest;",
|
||||
"test": "prep",
|
||||
"why": "小图被放大"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/model/ImagePrep.ts",
|
||||
"pat": "second\\.maxEdge = RETRY_EDGE;",
|
||||
"repl": "second.maxEdge = MAX_EDGE;",
|
||||
"test": "prep",
|
||||
"why": "退档不降分辨率"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/model/ImagePrep.ts",
|
||||
"pat": "second\\.quality = RETRY_QUALITY;",
|
||||
"repl": "second.quality = FIRST_QUALITY;",
|
||||
"test": "prep",
|
||||
"why": "退档不降质量"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/model/ImagePrep.ts",
|
||||
"pat": "return actualBytes > MAX_UPLOAD_BYTES;",
|
||||
"repl": "return actualBytes >= MAX_UPLOAD_BYTES;",
|
||||
"test": "prep",
|
||||
"why": "等于上限也退档"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/model/ImagePrep.ts",
|
||||
"pat": "if \\(sizeBytes > MAX_SOURCE_BYTES\\) \\{",
|
||||
"repl": "if (sizeBytes >= MAX_SOURCE_BYTES) {",
|
||||
"test": "prep",
|
||||
"why": "边界 >= 而不是 >"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/model/ImagePrep.ts",
|
||||
"pat": "if \\(!mimeType\\.startsWith\\('image/'\\)\\) \\{",
|
||||
"repl": "if (false) {",
|
||||
"test": "prep",
|
||||
"why": "不判类型"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/model/ImagePrep.ts",
|
||||
"pat": "return '上传失败:' \\+ serverMessage;",
|
||||
"repl": "return '上传失败';",
|
||||
"test": "prep",
|
||||
"why": "吞掉上传失败文案"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/model/ImagePrep.ts",
|
||||
"pat": "export const MAX_UPLOAD_BYTES: number = 3_670_016;",
|
||||
"repl": "export const MAX_UPLOAD_BYTES: number = 6_291_456;",
|
||||
"test": "prep",
|
||||
"why": "上限超过服务端 4MiB"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/model/ImagePrep.ts",
|
||||
"pat": "export const MAX_EDGE: number = 2560;",
|
||||
"repl": "export const MAX_EDGE: number = 4096;",
|
||||
"test": "prep",
|
||||
"why": "首档最长边改 4096"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/pages/AdminUsersPage.ets",
|
||||
"pat": " if \\(isRestricted\\(user\\)\\) \\{",
|
||||
"repl": " if (false) {",
|
||||
"test": "admin",
|
||||
"why": "去掉受限徽标"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/pages/AdminUsersPage.ets",
|
||||
"pat": " onlyStatus\\.status = 'active';",
|
||||
"repl": " onlyStatus.status = 'active';\n onlyStatus.display_name = this.editDisplayName;",
|
||||
"test": "admin",
|
||||
"why": "启停顺带发 display_name"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/pages/AdminUsersPage.ets",
|
||||
"pat": " \\.backgroundColor\\(Theme\\.surface\\)\n \\.borderRadius\\(Theme\\.radiusCard\\)\n \\.onClick\\(\\(\\) => \\{ this\\.toggleEdit\\(user\\); \\}\\)",
|
||||
"repl": " .backgroundColor('#123456')\n .onClick(() => { this.toggleEdit(user); })",
|
||||
"test": "admin",
|
||||
"why": "写死色值 + 去卡片圆角"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/pages/SettingsPage.ets",
|
||||
"pat": " this\\.isAdmin = false;\n \\}",
|
||||
"repl": " this.isAdmin = true;\n }",
|
||||
"test": "admin",
|
||||
"why": "身份读不到时乐观显示入口"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/pages/SettingsPage.ets",
|
||||
"pat": " if \\(this\\.isAdmin\\) \\{",
|
||||
"repl": " if (true) {",
|
||||
"test": "admin",
|
||||
"why": "管理入口不做门禁"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/pages/SettingsPage.ets",
|
||||
"pat": " @State isAdmin: boolean = false;",
|
||||
"repl": " @State isAdmin: boolean = true;",
|
||||
"test": "admin",
|
||||
"why": "isAdmin 初值 true"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/common/BackgroundPicker.ets",
|
||||
"pat": "if \\(!overLimit\\) \\{\n\\s*break;",
|
||||
"repl": "if (true) {\n break;",
|
||||
"test": "prep",
|
||||
"why": "永远只压第一档"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/common/BackgroundPicker.ets",
|
||||
"pat": "if \\(packed === null \\|\\| overLimit\\)",
|
||||
"repl": "if (packed === null)",
|
||||
"test": "prep",
|
||||
"why": "两档都超限不拒绝"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/common/BackgroundPicker.ets",
|
||||
"pat": "overLimit = shouldRetryWithActual\\(usedBytes\\);",
|
||||
"repl": "overLimit = false;",
|
||||
"test": "prep",
|
||||
"why": "结论恒 false"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/common/BackgroundPicker.ets",
|
||||
"pat": "await packer\\.release\\(\\);",
|
||||
"repl": "packer.release();",
|
||||
"test": "prep",
|
||||
"why": "packer.release 不 await"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/common/BackgroundPicker.ets",
|
||||
"pat": "await head\\.release\\(\\);",
|
||||
"repl": "head.release();",
|
||||
"test": "prep",
|
||||
"why": "head.release 不 await"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/common/BackgroundPicker.ets",
|
||||
"pat": "desiredSize: \\{ width: size\\.width, height: size\\.height \\}",
|
||||
"repl": "desiredSize: { width: info.size.width, height: info.size.height }",
|
||||
"test": "prep",
|
||||
"why": "按原图尺寸解码"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/common/BackgroundPicker.ets",
|
||||
"pat": " quality: Math\\.round\\(quality \\* 100\\)",
|
||||
"repl": " quality: quality",
|
||||
"test": "prep",
|
||||
"why": "quality 不换算"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/common/BackgroundPicker.ets",
|
||||
"pat": " this\\.onUploaded\\(UPLOAD_OK_HINT\\);",
|
||||
"repl": " this.bgKind = 'image';",
|
||||
"test": "prep",
|
||||
"why": "组件自己宣布成功"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/api/ApiClient.ets",
|
||||
"pat": "name: 'file',\n contentType: mimeType",
|
||||
"repl": "name: 'image',",
|
||||
"test": "prep",
|
||||
"why": "multipart 字段名不是 file(uploadBytes 那一处;此前锚点命中 2 次跑不起来,已切片)"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/api/AppearanceApi.ets",
|
||||
"pat": "fileName, 'image/jpeg'\\);",
|
||||
"repl": "fileName, 'application/octet-stream');",
|
||||
"test": "prep",
|
||||
"why": "上传 mime 发错"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/pages/SettingsPage.ets",
|
||||
"pat": " await store\\.syncFromServer\\(ctx, client\\);\n this\\.adoptSnapshot\\(store\\.current\\(\\), store\\.statusText\\(\\)\\);\n \\}\n\n /\\*\\* 把 store 里的快照复制进 @State",
|
||||
"repl": " this.bgKind = 'image';\n }\n\n /** 把 store 里的快照复制进 @State",
|
||||
"test": "prep",
|
||||
"why": "上传成功后不重新同步"
|
||||
}
|
||||
]
|
||||
1
client/electron/test/mutants/jobs/jobs-b3.json
Normal file
1
client/electron/test/mutants/jobs/jobs-b3.json
Normal file
@ -0,0 +1 @@
|
||||
[{"file":"client/harmony/entry/src/main/ets/model/Wallpaper.ts","pat":"plan\\.blurPx = normalizeBlur\\(blurPx\\);","repl":"plan.blurPx = 0;","test":"wallpaper","why":"计划不搬运模糊值"}]
|
||||
45
client/electron/test/mutants/jobs/jobs-blur.json
Normal file
45
client/electron/test/mutants/jobs/jobs-blur.json
Normal file
@ -0,0 +1,45 @@
|
||||
[
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/pages/MainPage.ets",
|
||||
"pat": "\\.blur\\(this\\.bgPlan\\.blurPx\\)",
|
||||
"repl": ".blur(0)",
|
||||
"test": "prep",
|
||||
"why": "壁纸层忘了糊(滑杆能拖、壁纸不动)"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/pages/MainPage.ets",
|
||||
"pat": "\\.backgroundBlurStyle\\(BLUR_STYLE_OF\\[blurStyleFor\\(this\\.bgPlan\\.blurPx\\)\\] \\?\\? BlurStyle\\.NONE\\)",
|
||||
"repl": ".backgroundBlurStyle(Theme.navMaterial)",
|
||||
"test": "prep",
|
||||
"why": "导航条材质又写死成固定档(不再跟用户偏好)",
|
||||
"retired": "那句已按 pi 的复核改掉(导航条回到 Theme.navMaterial 固定档);当前形态由 jobs-pi.json 的锚点覆盖"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/pages/MainPage.ets",
|
||||
"pat": "'COMPONENT_THIN': BlurStyle\\.COMPONENT_THIN,",
|
||||
"repl": "'COMPONENT_THINN': BlurStyle.COMPONENT_THIN,",
|
||||
"test": "admin",
|
||||
"why": "(锚点:那张表的键写错,判据在 appearance)"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/pages/MainPage.ets",
|
||||
"pat": " 'COMPONENT_REGULAR': BlurStyle\\.COMPONENT_REGULAR,\n",
|
||||
"repl": "",
|
||||
"test": "admin",
|
||||
"why": "(锚点:表里漏一档)"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/model/Wallpaper.ts",
|
||||
"pat": "plan\\.blurPx = normalizeBlur\\(blurPx\\);",
|
||||
"repl": "plan.blurPx = 0;",
|
||||
"test": "admin",
|
||||
"why": "(锚点:计划不搬运模糊值)"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/pages/MainPage.ets",
|
||||
"pat": "dark, snap\\.bgBlur\\)",
|
||||
"repl": "dark, 0)",
|
||||
"test": "admin",
|
||||
"why": "(锚点:页面没把模糊档传给计划)"
|
||||
}
|
||||
]
|
||||
59
client/electron/test/mutants/jobs/jobs-blur2.json
Normal file
59
client/electron/test/mutants/jobs/jobs-blur2.json
Normal file
@ -0,0 +1,59 @@
|
||||
[
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/pages/MainPage.ets",
|
||||
"pat": "\\.blur\\(this\\.bgPlan\\.blurPx\\)",
|
||||
"repl": ".blur(0)",
|
||||
"test": "appearance",
|
||||
"why": "壁纸层忘了糊(滑杆能拖、壁纸不动)"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/pages/MainPage.ets",
|
||||
"pat": "\\.backgroundBlurStyle\\(BLUR_STYLE_OF\\[blurStyleFor\\(this\\.bgPlan\\.blurPx\\)\\] \\?\\? BlurStyle\\.NONE\\)",
|
||||
"repl": ".backgroundBlurStyle(Theme.navMaterial)",
|
||||
"test": "appearance",
|
||||
"why": "导航条材质写死成固定档(不跟用户偏好)",
|
||||
"retired": "同 jobs-blur.json 那条:旧写法已按 pi 的复核改掉;由 jobs-pi.json 的当前形态锚点覆盖"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/pages/MainPage.ets",
|
||||
"pat": "'COMPONENT_THIN': BlurStyle\\.COMPONENT_THIN,",
|
||||
"repl": "'COMPONENT_THINN': BlurStyle.COMPONENT_THIN,",
|
||||
"test": "appearance",
|
||||
"why": "档位名 → 枚举表的键写错(真机上表现为拖滑杆没反应)"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/pages/MainPage.ets",
|
||||
"pat": " 'COMPONENT_REGULAR': BlurStyle\\.COMPONENT_REGULAR,\n",
|
||||
"repl": "",
|
||||
"test": "appearance",
|
||||
"why": "表里漏一档(该档静默回落成不模糊)"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/model/Wallpaper.ts",
|
||||
"pat": "plan\\.blurPx = normalizeBlur\\(blurPx\\);",
|
||||
"repl": "plan.blurPx = 0;",
|
||||
"test": "appearance",
|
||||
"why": "计划不搬运模糊值"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/pages/MainPage.ets",
|
||||
"pat": "dark, snap\\.bgBlur\\)",
|
||||
"repl": "dark, 0)",
|
||||
"test": "appearance",
|
||||
"why": "页面没把模糊档传给计划"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/pages/MainPage.ets",
|
||||
"pat": "\\.blur\\(this\\.bgPlan\\.blurPx\\)",
|
||||
"repl": ".blur(this.bgPlan.blurPx).blur(this.bgPlan.blurPx)",
|
||||
"test": "nav",
|
||||
"why": "壁纸层糊两遍(同一张底糊两次)"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/pages/MainPage.ets",
|
||||
"pat": "\\.blur\\(this\\.bgPlan\\.blurPx\\)",
|
||||
"repl": ".backgroundBlurStyle(BlurStyle.COMPONENT_THICK)",
|
||||
"test": "nav",
|
||||
"why": "壁纸层改用面板材质(同一张底糊两遍的形状)"
|
||||
}
|
||||
]
|
||||
1
client/electron/test/mutants/jobs/jobs-neg0.json
Normal file
1
client/electron/test/mutants/jobs/jobs-neg0.json
Normal file
@ -0,0 +1 @@
|
||||
[{"file":"client/harmony/entry/src/main/ets/model/Wallpaper.ts","pat":" if \\(!\\(r > 0\\)\\) \\{\n return 0;\n \\}","repl":" if (r < 0) {\n return 0;\n }","test":"wallpaper","why":"把 -0 那个修复改回去(判据该红)"}]
|
||||
6
client/electron/test/mutants/jobs/jobs-one.json
Normal file
6
client/electron/test/mutants/jobs/jobs-one.json
Normal file
@ -0,0 +1,6 @@
|
||||
[
|
||||
{"file":"client/harmony/entry/src/main/ets/api/ApiClient.ets",
|
||||
"pat":"name: 'file',\n contentType: mimeType",
|
||||
"repl":"name: 'image',\n contentType: mimeType",
|
||||
"test":"prep","why":"multipart 字段名不是 file(uploadBytes 那一处)"}
|
||||
]
|
||||
18
client/electron/test/mutants/jobs/jobs-pi.json
Normal file
18
client/electron/test/mutants/jobs/jobs-pi.json
Normal file
@ -0,0 +1,18 @@
|
||||
[
|
||||
{"file":"client/harmony/entry/src/main/ets/pages/MainPage.ets",
|
||||
"pat":"\\.backgroundBlurStyle\\(NAV_MATERIAL_OF\\[navMaterialFor\\(this\\.bgPlan\\.blurPx\\)\\] \\?\\? Theme\\.navMaterial\\)",
|
||||
"repl":".backgroundBlurStyle(BlurStyle.COMPONENT_THICK)",
|
||||
"test":"cross","why":"导航条绕开 Theme.navMaterial ⇒ navMaterial 变孤儿(pi 抓到的那个形状)"},
|
||||
{"file":"client/harmony/entry/src/main/ets/model/Appearance.ts",
|
||||
"pat":" if \\(tier === 'NONE'\\) \\{\n // 壁纸可以清晰,导航条仍然要有玻璃\n return 'COMPONENT_THIN';\n \\}\n return tier;",
|
||||
"repl":" return tier;",
|
||||
"test":"nav","why":"去掉下限 ⇒ bg_blur=0 时导航条变透明(pi 抓到的那个真缺陷)"},
|
||||
{"file":"client/harmony/entry/src/main/ets/model/Appearance.ts",
|
||||
"pat":"export function navMaterialFor\\(bgBlur: number\\): string \\{\n const tier: string = blurStyleFor\\(bgBlur\\);",
|
||||
"repl":"export function navMaterialFor(bgBlur: number): string {\n const tier: string = 'COMPONENT_THIN';",
|
||||
"test":"nav","why":"恒定最薄档 ⇒ 滑杆在导航条上是死控件(判据该红)"},
|
||||
{"file":"client/harmony/entry/src/main/ets/pages/MainPage.ets",
|
||||
"pat":" 'COMPONENT_THICK': BlurStyle\\.COMPONENT_THICK\n\\};",
|
||||
"repl":"};",
|
||||
"test":"appearance","why":"导航空表里漏最厚档(该档静默回落成 fallback)"}
|
||||
]
|
||||
54
client/electron/test/mutants/jobs/jobs1.json
Normal file
54
client/electron/test/mutants/jobs/jobs1.json
Normal file
@ -0,0 +1,54 @@
|
||||
[
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/common/BackgroundPicker.ets",
|
||||
"pat": "if \\(!shouldRetryWithActual\\(usedBytes\\)\\) \\{\n\\s*break;",
|
||||
"repl": "if (true) {\n break;",
|
||||
"test": "prep",
|
||||
"why": "永远只压第一档(不看真实字节数)",
|
||||
"retired": "重锚后见 jobs2.json / jobs-all.json 的 `!overLimit` 那条(已跑已红)"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/common/BackgroundPicker.ets",
|
||||
"pat": "if \\(packed === null \\|\\| shouldRetryWithActual\\(usedBytes\\)\\)",
|
||||
"repl": "if (packed === null)",
|
||||
"test": "prep",
|
||||
"why": "两档都超限时不拒绝(把超限图直传成 413)",
|
||||
"retired": "重锚后见 jobs2.json 的 `packed === null || overLimit`(已跑已红)"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/common/BackgroundPicker.ets",
|
||||
"pat": "await packer\\.release\\(\\);",
|
||||
"repl": "packer.release();",
|
||||
"test": "prep",
|
||||
"why": "ImagePacker.release 不 await"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/common/BackgroundPicker.ets",
|
||||
"pat": "await head\\.release\\(\\);",
|
||||
"repl": "head.release();",
|
||||
"test": "prep",
|
||||
"why": "head.release 不 await"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/api/ApiClient.ets",
|
||||
"pat": "name: 'file',",
|
||||
"repl": "name: 'image',",
|
||||
"test": "prep",
|
||||
"why": "multipart 字段名不是 file",
|
||||
"retired": "同一条在 jobs-one.json 里有切片后的精确锚点(已跑已红)"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/api/ApiClient.ets",
|
||||
"pat": "data: data",
|
||||
"repl": "data: ''",
|
||||
"test": "prep",
|
||||
"why": "内存字节没放进 data(改走 filePath 那条不存在的路)"
|
||||
},
|
||||
{
|
||||
"file": "client/harmony/entry/src/main/ets/common/BackgroundPicker.ets",
|
||||
"pat": "desiredSize: \\{ width: size\\.width, height: size\\.height \\}",
|
||||
"repl": "desiredSize: { width: info.size.width, height: info.size.height }",
|
||||
"test": "prep",
|
||||
"why": "不按目标尺寸解码(4K 图整图解码,低端机爆内存)"
|
||||
}
|
||||
]
|
||||
22
client/electron/test/mutants/jobs/jobs2.json
Normal file
22
client/electron/test/mutants/jobs/jobs2.json
Normal file
@ -0,0 +1,22 @@
|
||||
[
|
||||
{"file":"client/harmony/entry/src/main/ets/common/BackgroundPicker.ets",
|
||||
"pat":"if \\(!overLimit\\) \\{\n\\s*break;",
|
||||
"repl":"if (true) {\n break;",
|
||||
"test":"prep","why":"永远只压第一档(重测)"},
|
||||
{"file":"client/harmony/entry/src/main/ets/common/BackgroundPicker.ets",
|
||||
"pat":"if \\(packed === null \\|\\| overLimit\\)",
|
||||
"repl":"if (packed === null)",
|
||||
"test":"prep","why":"两档都超限时不拒绝(重测)"},
|
||||
{"file":"client/harmony/entry/src/main/ets/common/BackgroundPicker.ets",
|
||||
"pat":"overLimit = shouldRetryWithActual\\(usedBytes\\);",
|
||||
"repl":"overLimit = false;",
|
||||
"test":"prep","why":"结论永远为 false(超限图被放过去)"},
|
||||
{"file":"client/harmony/entry/src/main/ets/common/BackgroundPicker.ets",
|
||||
"pat":"if \\(packed === null \\|\\| overLimit\\) \\{\n\\s*this\\.fail\\(TOO_LARGE_REASON\\);",
|
||||
"repl":"if (packed === null) {\n this.fail(TOO_LARGE_REASON);",
|
||||
"test":"prep","why":"拒绝分支里不带原因"},
|
||||
{"file":"client/harmony/entry/src/main/ets/common/BackgroundPicker.ets",
|
||||
"pat":"desiredSize: \\{ width: size\\.width, height: size\\.height \\}",
|
||||
"repl":"desiredSize: { width: info.size.width, height: info.size.height }",
|
||||
"test":"prep","why":"不按目标尺寸解码(4K 图整图解码)"}
|
||||
]
|
||||
Reference in New Issue
Block a user