```CEDARScript
--- 2nd pst becomes inner of A3
+# 2nd pst becomes inner of A3
UPDATE FUNCTION "pst" OFFSET 1 FROM FILE "main.py"
MOVE WHOLE INSERT AFTER CLASS "A3"
RELATIVE INDENTATION 1;
diff --git a/tests/test_corpus.py b/tests/test_corpus.py
index 02a2c15..0408725 100644
--- a/tests/test_corpus.py
+++ b/tests/test_corpus.py
@@ -1,11 +1,13 @@
import re
import shutil
+import sys
import tempfile
import pytest
from pathlib import Path
from cedarscript_editor import find_commands, CEDARScriptEditor
+_no_windows = '!nowindows'
def get_test_cases() -> list[str]:
"""Get all test cases from tests/corpus directory.
@@ -40,6 +42,9 @@ def editor(tmp_path_factory):
@pytest.mark.parametrize('test_case', get_test_cases())
def test_corpus(editor: CEDARScriptEditor, test_case: str):
"""Test CEDARScript commands from chat.xml files in corpus."""
+ if test_case.casefold().endswith(_no_windows) and sys.platform == 'win32':
+ pytest.skip(f"Cannot run under Windows: {test_case.removesuffix(_no_windows)}")
+
try:
corpus_dir = Path(__file__).parent / 'corpus'
test_dir = corpus_dir / test_case
@@ -90,10 +95,10 @@ def check_expected_files(dir_path: Path):
continue
# Find corresponding expected file in test directory
rel_path = path.relative_to(editor.root_path)
- if str(rel_path).startswith("."):
+ if str(rel_path).startswith(".") or str(rel_path).endswith("~"):
continue
expected_file = test_dir / f"expected.{rel_path}"
- assert expected_file.exists(), f"'expecteed.*' file not found: {expected_file}"
+ assert expected_file.exists(), f"'expected.*' file not found: '{expected_file}'"
expected_content = file_to_lines(expected_file, rel_path)
actual_content = file_to_lines(path, rel_path)
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy