[gemma4] update tests

This commit is contained in:
2026-06-19 17:52:38 +02:00
parent d6bd5f4096
commit 49f0f23a54
4 changed files with 117 additions and 18 deletions
+30
View File
@@ -0,0 +1,30 @@
from skillls.checker import check_content_for_errors, ParenMismatchErrorKind
import pytest
def test_check_content_no_errors():
content = "(defun my_func (arg) (print arg))"
# Should not raise any exception
try:
check_content_for_errors(content)
except Exception as e:
pytest.fail(f"Expected no error, but got {e}")
def test_check_content_too_many_closed():
content = "())"
with pytest.raises(ExceptionGroup) as eg:
check_content_for_errors(content)
# Check if the error type is correct
exceptions = eg.value.exceptions
assert any(isinstance(ex, Exception) and ex.kind == ParenMismatchErrorKind.TooManyClosed for ex in exceptions)
def test_check_content_too_many_opened():
content = "((defun my_func (arg)"
with pytest.raises(ExceptionGroup) as eg:
check_content_for_errors(content)
exceptions = eg.value.exceptions
assert any(isinstance(ex, Exception) and ex.kind == ParenMismatchErrorKind.TooManyOpened for ex in exceptions)
def test_check_content_empty():
check_content_for_errors("")