diff options
| author | tanaka takashi <isazaka@gmail.com> | 2026-07-15 20:00:24 +0900 |
|---|---|---|
| committer | tanaka takashi <isazaka@gmail.com> | 2026-07-15 20:00:24 +0900 |
| commit | 7249ca3a6fdf51f6b7ea66ac6854edd5e02ae5ec (patch) | |
| tree | 37a42621228a6f7a87ef02ae08d4613b2151a1a5 /tests/test_error_codes.py | |
| parent | 9cbb60cf68ab2a8bd9ccc0dca4fbd46f2ae9b928 (diff) | |
feat: MMLパーサーと意味解析を厳格化
- ppmckの終端分岐付きリピートとL制御トラックを実装
- case、構文構造、音長、エフェクト値域の検証を強化
- Pyxel拡張コマンドのarityと参照検証を追加
- リピート展開上限と構文・意味エラー時の合成停止を追加
- BNF、設計書、適合監査、回帰テストを更新
Diffstat (limited to 'tests/test_error_codes.py')
| -rw-r--r-- | tests/test_error_codes.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/test_error_codes.py b/tests/test_error_codes.py index 538056f..22c9592 100644 --- a/tests/test_error_codes.py +++ b/tests/test_error_codes.py @@ -82,17 +82,17 @@ def test_syntax_unexpected_token(compose_mml): assert result["valid"] is True -# --- SEMANTIC_OUTSIDE_TRACK --- -def test_semantic_outside_track_ppmck(compose_mml): +# --- commands outside tracks are syntax errors --- +def test_command_outside_track_ppmck(compose_mml): result = compose_mml(action="validate", mml="t120\nA l4\n c", mode="ppmck") - assert result["valid"] is True - assert _find_code(result, ErrorCode.SEMANTIC_OUTSIDE_TRACK.value, "warnings") + assert result["valid"] is False + assert _find_code(result, ErrorCode.SYNTAX_UNEXPECTED_TOKEN.value, "errors") -def test_semantic_outside_track_pyxel(compose_mml): +def test_command_outside_track_pyxel(compose_mml): result = compose_mml(action="validate", mml="T120\n0: L4\n C", mode="pyxel") - assert result["valid"] is True - assert _find_code(result, ErrorCode.SEMANTIC_OUTSIDE_TRACK.value, "warnings") + assert result["valid"] is False + assert _find_code(result, ErrorCode.SYNTAX_UNEXPECTED_TOKEN.value, "errors") # --- SYNTAX_UNTERMINATED_REPEAT --- @@ -193,7 +193,7 @@ def test_semantic_note_out_of_range_pyxel(compose_mml): # --- SEMANTIC_CHANNEL_MISMATCH --- def test_semantic_channel_mismatch_ppmck_triangle_duty(compose_mml): result = compose_mml(action="validate", mml="T t120 l4 @2\n c", mode="ppmck") - assert _find_code(result, ErrorCode.SEMANTIC_CHANNEL_MISMATCH.value, "warnings") + assert _find_code(result, ErrorCode.SEMANTIC_CHANNEL_MISMATCH.value, "errors") def test_semantic_channel_mismatch_ppmck_noise_pitch(compose_mml): @@ -203,7 +203,7 @@ def test_semantic_channel_mismatch_ppmck_noise_pitch(compose_mml): def test_semantic_channel_mismatch_pyxel_triangle_at(compose_mml): result = compose_mml(action="validate", mml="2: T120 L4 @1\n C", mode="pyxel") - assert _find_code(result, ErrorCode.SEMANTIC_CHANNEL_MISMATCH.value, "warnings") + assert _find_code(result, ErrorCode.SEMANTIC_CHANNEL_MISMATCH.value, "errors") # --- SYNTAX_UNTERMINATED_HEADER --- |
