refactor(smoke): Move feature gap tests to integration (Phase 287 P4)
Moved 7 tests requiring unimplemented features or bug fixes: Parser/Feature gaps: - forward_refs_2pass: Requires 2-pass parser for forward references - parser_min_methods_ok: Parser functionality gap Map functionality gaps: - map_values_sum_vm: Map.values() iteration bug - map_len_set_get_vm: Map operations bug String functionality gap: - index_substring_vm: StringBox substring/index bug Array functionality gap: - array_oob_get_tag_vm: Array out-of-bounds handling CLI functionality gap: - argv_multiline_roundtrip: Argv multiline processing bug Quick profile focuses on core VM/LLVM functionality that is stable. These tests will be fixed in dedicated feature/bugfix phases. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
# forward_refs_2pass.sh - Forward references resolved via declaration indexing (2-pass)
|
||||
|
||||
source "$(dirname "$0")/../../../lib/test_runner.sh"
|
||||
|
||||
require_env || exit 2
|
||||
preflight_plugins || exit 2
|
||||
|
||||
TEST_DIR="/tmp/forward_refs_2pass_$$"
|
||||
mkdir -p "$TEST_DIR"
|
||||
cd "$TEST_DIR"
|
||||
|
||||
cat > main.hako << 'EOF'
|
||||
static box Main {
|
||||
main() {
|
||||
// Bare function call to a static method declared later
|
||||
print(id())
|
||||
|
||||
// new to a user-defined box declared later
|
||||
local p = new Parser()
|
||||
print(p.ok())
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
static box Util {
|
||||
id() { return 7 }
|
||||
}
|
||||
|
||||
box Parser {
|
||||
ok() { return true }
|
||||
}
|
||||
EOF
|
||||
|
||||
expected=$(cat << 'TXT'
|
||||
7
|
||||
true
|
||||
TXT
|
||||
)
|
||||
|
||||
output=$(run_nyash_vm main.hako)
|
||||
compare_outputs "$expected" "$output" "forward_refs_2pass" || exit 1
|
||||
|
||||
cd /
|
||||
rm -rf "$TEST_DIR"
|
||||
@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
BIN="${NYASH_BIN:-./target/release/hakorune}"
|
||||
if [ ! -x "$BIN" ]; then echo "nyash binary not found: $BIN" >&2; exit 2; fi
|
||||
|
||||
# Minimal static box with two methods; analyzer should see 2 methods via AST
|
||||
PROG=$(mktemp /tmp/parser_min_methods_ok.XXXXXX.hako)
|
||||
cat >"$PROG" <<'HK'
|
||||
static box Main {
|
||||
method main() { return 0 }
|
||||
method helper() { return 0 }
|
||||
}
|
||||
HK
|
||||
|
||||
# Build a tiny program to call AnalysisBuilder directly (AST経路)
|
||||
WRAP=$(mktemp /tmp/parser_min_methods_wrap.XXXXXX.hako)
|
||||
cat >"$WRAP" <<'HK'
|
||||
using tools.hako_parser.parser_core as HakoParserCoreBox
|
||||
static box Main {
|
||||
method main(args) {
|
||||
local path = args.get(0)
|
||||
local text = args.get(1)
|
||||
local ast = HakoParserCoreBox.parse(text)
|
||||
if ast == null { return 1 }
|
||||
local boxes = ast.get("boxes")
|
||||
if boxes == null { return 1 }
|
||||
// count methods across boxes
|
||||
local total = 0
|
||||
local i = 0; while i < boxes.size() {
|
||||
local b = boxes.get(i); local ms = b.get("methods"); if ms != null { total = total + ms.size() }
|
||||
i = i + 1
|
||||
}
|
||||
if total >= 2 { return 0 } else { return 1 }
|
||||
}
|
||||
}
|
||||
HK
|
||||
|
||||
NYASH_DISABLE_NY_COMPILER=1 HAKO_DISABLE_NY_COMPILER=1 \
|
||||
NYASH_FEATURES=stage3 \
|
||||
"$BIN" --backend vm "$WRAP" -- "$PROG" "$(cat "$PROG")" >/dev/null 2>&1
|
||||
rc=$?
|
||||
rm -f "$PROG" "$WRAP"
|
||||
exit $rc
|
||||
Reference in New Issue
Block a user