| 1 | """ |
| 2 | test_text_format_unit |
| 3 | ===================== |
| 4 | |
| 5 | Focused checks for the text format adapter's layer ordering. |
| 6 | """ |
| 7 | from __future__ import annotations |
| 8 | |
| 9 | import os |
| 10 | import sys |
| 11 | |
| 12 | ROOT = os.path.join(os.path.dirname(__file__), "..") |
| 13 | sys.path.insert(0, ROOT) |
| 14 | |
| 15 | from oversight_core import watermark |
| 16 | from oversight_core.formats import text as text_format |
| 17 | |
| 18 | |
| 19 | def test_text_adapter_matches_core_order(): |
| 20 | original = ( |
| 21 | "We begin to show how this is significant and we must help users find answers.\n" |
| 22 | "A second paragraph helps the semantic watermark choose visible variants." |
| 23 | ) |
| 24 | mark_id = watermark.new_mark_id() |
| 25 | via_adapter = text_format.apply(original, mark_id, layers=("L1", "L2", "L3")) |
| 26 | via_core = watermark.apply_all(original, mark_id, include_l3=True) |
| 27 | assert via_adapter == via_core, "text adapter diverged from core watermark order" |