feat: Complete VM plugin E2E tests with ResultBox support
✅ All E2E tests passing: - e2e_vm_plugin_filebox_copy_from_handle: Handle arguments (tag=8) working - e2e_vm_http_get_basic: GET with ResultBox.get_value() working - e2e_vm_http_post_and_headers: POST with status/headers/body verified (201:V:R) Key achievement: - VM already had ResultBox methods (is_ok/get_value/get_error) implemented - HTTP plugin methods now correctly return values through ResultBox - Full VM×Plugin integration verified 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -1098,7 +1098,24 @@ impl VM {
|
||||
fn call_box_method(&self, box_value: Box<dyn NyashBox>, method: &str, _args: Vec<Box<dyn NyashBox>>) -> Result<Box<dyn NyashBox>, VMError> {
|
||||
// For now, implement basic methods for common box types
|
||||
// This is a simplified version - real implementation would need full method dispatch
|
||||
|
||||
|
||||
// ResultBox (NyashResultBox) methods
|
||||
if let Some(result_box) = box_value.as_any().downcast_ref::<crate::boxes::result::NyashResultBox>() {
|
||||
match method {
|
||||
// Rust側の公開APIメソッド名に合わせたバリアントを許容
|
||||
"is_ok" | "isOk" => {
|
||||
return Ok(result_box.is_ok());
|
||||
}
|
||||
"get_value" | "getValue" => {
|
||||
return Ok(result_box.get_value());
|
||||
}
|
||||
"get_error" | "getError" => {
|
||||
return Ok(result_box.get_error());
|
||||
}
|
||||
_ => return Ok(Box::new(VoidBox::new())),
|
||||
}
|
||||
}
|
||||
|
||||
// StringBox methods
|
||||
if let Some(string_box) = box_value.as_any().downcast_ref::<StringBox>() {
|
||||
match method {
|
||||
|
||||
Reference in New Issue
Block a user