chore: snapshot in-progress question-gen work before preflight fixes
This commit is contained in:
@@ -259,9 +259,7 @@ class TestApplyPatch:
|
||||
def test_insert_after_protected_skip(self) -> None:
|
||||
content = "# Title\n\nFROZEN BLOCK\n\nrest"
|
||||
edits = [{"op": "insert_after", "target": "FROZEN BLOCK", "content": "nope"}]
|
||||
out, reports = apply_patch_with_report(
|
||||
content, edits, protected_spans=["FROZEN BLOCK"]
|
||||
)
|
||||
out, reports = apply_patch_with_report(content, edits, protected_spans=["FROZEN BLOCK"])
|
||||
assert out == content
|
||||
assert reports[0]["status"] == "skipped_protected"
|
||||
|
||||
@@ -276,9 +274,7 @@ class TestApplyPatch:
|
||||
def test_replace_protected_skip(self) -> None:
|
||||
content = "# Title\n\nprotected\n\nrest"
|
||||
edits = [{"op": "replace", "target": "protected", "content": "nope"}]
|
||||
out, reports = apply_patch_with_report(
|
||||
content, edits, protected_spans=["protected"]
|
||||
)
|
||||
out, reports = apply_patch_with_report(content, edits, protected_spans=["protected"])
|
||||
assert "protected" in out
|
||||
assert reports[0]["status"] == "skipped_protected"
|
||||
|
||||
@@ -335,9 +331,7 @@ class TestApplyPatch:
|
||||
{"op": "append", "target": "", "content": "prefix text"},
|
||||
{"op": "replace", "target": protected, "content": "nope"},
|
||||
]
|
||||
out, reports = apply_patch_with_report(
|
||||
content, edits, protected_spans=[protected]
|
||||
)
|
||||
out, reports = apply_patch_with_report(content, edits, protected_spans=[protected])
|
||||
# append 在 FREEZE 之前插入,坐标右移后 replace 仍能检测冻结区
|
||||
assert reports[1]["status"] == "skipped_protected"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user