diff options
Diffstat (limited to '.ai/scripts/tests/test-lint-org.el')
| -rw-r--r-- | .ai/scripts/tests/test-lint-org.el | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/.ai/scripts/tests/test-lint-org.el b/.ai/scripts/tests/test-lint-org.el index 60deb8c..d4b3ba0 100644 --- a/.ai/scripts/tests/test-lint-org.el +++ b/.ai/scripts/tests/test-lint-org.el @@ -599,5 +599,47 @@ followups file on the next run." (lo-test--drop-buffer file) (when (file-exists-p file) (delete-file file))))) +;;; --------------------------------------------------------------------------- +;;; org-table-standard check (width budget + rules between rows) + +(ert-deftest lo-table-over-budget-emits-judgment () + "A table line rendering wider than 120 surfaces as an org-table-standard judgment." + (let* ((wide (make-string 130 ?x)) + (run (lo-test--run (format "* H\n\n| a |\n|---|\n| %s |\n|---|\n" wide))) + (judgments (lo-test--judgments (plist-get run :issues)))) + (should (memq 'org-table-standard (lo-test--checkers judgments))) + (should (cl-some (lambda (i) (lo-test--has (plist-get i :msg) "120")) + judgments)))) + +(ert-deftest lo-table-compliant-not-flagged () + "A narrow table with rules under header and every row passes silently." + (let* ((run (lo-test--run "* H\n\n| a |\n|---|\n| ok |\n|---|\n")) + (judgments (lo-test--judgments (plist-get run :issues)))) + (should-not (memq 'org-table-standard (lo-test--checkers judgments))))) + +(ert-deftest lo-table-missing-interrow-rules-emits-judgment () + "Data rows without a rule between them violate the standard." + (let* ((run (lo-test--run "* H\n\n| a | b |\n|---+---|\n| 1 | 2 |\n| 3 | 4 |\n")) + (judgments (lo-test--judgments (plist-get run :issues)))) + (should (memq 'org-table-standard (lo-test--checkers judgments))) + (should (cl-some (lambda (i) (lo-test--has (plist-get i :msg) "rule")) + judgments)))) + +(ert-deftest lo-table-wide-link-source-measures-render-width () + "A long link target doesn't trip the budget — width is render-measured." + (let* ((target (concat "https://example.com/" (make-string 120 ?p))) + (run (lo-test--run + (format "* H\n\n| [[%s][ok]] |\n|---|\n| x |\n|---|\n" target))) + (judgments (lo-test--judgments (plist-get run :issues)))) + (should-not (memq 'org-table-standard (lo-test--checkers judgments))))) + +(ert-deftest lo-table-conformant-wrapped-table-not-flagged () + "Continuation rows inside a rule-delimited group are one logical row, not a +missing-rules violation." + (let* ((run (lo-test--run + "* H\n\n| Name | Notes |\n|-------+-------------------|\n| alpha | wrapped text that |\n| | continues here |\n|-------+-------------------|\n")) + (judgments (lo-test--judgments (plist-get run :issues)))) + (should-not (memq 'org-table-standard (lo-test--checkers judgments))))) + (provide 'test-lint-org) ;;; test-lint-org.el ends here |
