From ae594092826cf5ad30a1e7a8e2b666a237efd230 Mon Sep 17 00:00:00 2001 From: nyash-codex Date: Mon, 15 Dec 2025 12:35:59 +0900 Subject: [PATCH] test: Phase 133 P0 - Promoted carrier join_id test fixture (JsonParser pattern) --- .../phase133_json_skip_whitespace_min.hako | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 apps/tests/phase133_json_skip_whitespace_min.hako diff --git a/apps/tests/phase133_json_skip_whitespace_min.hako b/apps/tests/phase133_json_skip_whitespace_min.hako new file mode 100644 index 00000000..75a3f867 --- /dev/null +++ b/apps/tests/phase133_json_skip_whitespace_min.hako @@ -0,0 +1,29 @@ +// Phase 133 P0: Promoted carrier join_id test (JsonParser._skip_whitespace pattern) +// 目的: Loop + promoted carrier の join_id 問題を検証・修正(Phase 133課題) +// Issue: promoted carrier 'is_char_match' has no join_id when break is used +// Pattern: [cond_promoter] A-3 Trim pattern promoted → [phase229] no join_id error +// Input: " X" (3 spaces + character) +// Expected: return 3 (count of leading spaces before first non-space) +// Verification: exit code (VM: RC, LLVM EXE: exit code) + +static box Main { + countSpaces(s) { + local count = 0 + local index = 0 + loop(index < s.length()) { + local char = s.substring(index, index + 1) + if char == " " { + count = count + 1 + index = index + 1 + } else { + break + } + } + return count + } + + main() { + local input = " X" + return me.countSpaces(input) // Expected: 3 + } +}