🎉 feat: ChatGPT5による奇跡の全テスト修復完了!

- instance_v2移行で破綻していた440個のテストを30分で全修正
- git巻き戻しレベルの状況から完全復活
- 人間には不可能な速度での大規模整合性修正

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Moe Charm
2025-08-20 04:45:26 +09:00
parent 9eb52982b5
commit bab57e7c07
18 changed files with 950 additions and 135 deletions

View File

@ -1,13 +1,14 @@
#[cfg(test)]
mod array_state_sharing_tests {
use crate::interpreter::Interpreter;
use crate::boxes::array::ArrayBox;
use crate::box_trait::{NyashBox, IntegerBox, StringBox};
use nyash_rust::interpreter::NyashInterpreter;
use nyash_rust::parser::NyashParser;
use nyash_rust::boxes::array::ArrayBox;
use nyash_rust::box_trait::{NyashBox, IntegerBox, StringBox};
#[test]
fn test_arraybox_state_sharing_bug_fix() {
// 🚨 問題再現テスト
let mut interpreter = Interpreter::new();
let mut interpreter = NyashInterpreter::new();
let program = r#"
static box Main {
init { result }
@ -21,7 +22,8 @@ mod array_state_sharing_tests {
}
"#;
let result = interpreter.execute_program(program).unwrap();
let ast = NyashParser::parse_from_string(program).unwrap();
let result = interpreter.execute(ast).unwrap();
let int_result = result.as_any().downcast_ref::<IntegerBox>().unwrap();
assert_eq!(int_result.value, 1); // 🎯 0ではなく1を返すべき
}
@ -47,7 +49,7 @@ mod array_state_sharing_tests {
#[test]
fn test_multiple_operations_state_preservation() {
let mut interpreter = Interpreter::new();
let mut interpreter = NyashInterpreter::new();
let program = r#"
static box Main {
init { result }
@ -63,8 +65,9 @@ mod array_state_sharing_tests {
}
"#;
let result = interpreter.execute_program(program).unwrap();
let ast = NyashParser::parse_from_string(program).unwrap();
let result = interpreter.execute(ast).unwrap();
let int_result = result.as_any().downcast_ref::<IntegerBox>().unwrap();
assert_eq!(int_result.value, 3); // 3要素が正しく保持されるべき
}
}
}