From 1cfbfe8c3c4bccc3fa58c0f59d2fb690cf6b931f Mon Sep 17 00:00:00 2001 From: Moe Charm Date: Wed, 20 Aug 2025 14:43:39 +0900 Subject: [PATCH] =?UTF-8?q?test:=20integration=5Ftests.rs=E3=82=92?= =?UTF-8?q?=E6=96=B0=E3=81=97=E3=81=84Nyash=E6=A7=8B=E6=96=87=E3=81=AB?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 古い構文から新しい構文への更新: - this → me に変更 - フィールド宣言を init { } 構文に変更 - init()メソッド → birth()コンストラクタに変更 結果: 16個の統合テストすべて成功 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- tests/integration_tests.rs | 51 ++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 2b1dacbc..190e736e 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -148,11 +148,10 @@ mod integration_tests { fn test_box_instance_creation() { let code = r#" box Point { - x - y + init { x, y } getX() { - return this.x + return me.x } } @@ -172,16 +171,16 @@ mod integration_tests { value setValue(v) { - this.value = v + me.value = v } getValue() { - return this.value + return me.value } add(amount) { - this.value = this.value + amount - return this.value + me.value = me.value + amount + return me.value } } @@ -199,25 +198,23 @@ mod integration_tests { fn test_method_chaining_concept() { let code = r#" box Counter { - count + init { count } - init() { - this.count = 0 - return this + birth() { + me.count = 0 } increment() { - this.count = this.count + 1 - return this.count + me.count = me.count + 1 + return me.count } getCount() { - return this.count + return me.count } } c = new Counter() - c.init() c.increment() c.increment() c.increment() @@ -232,14 +229,14 @@ mod integration_tests { fn test_multiple_instances() { let code = r#" box Data { - value + init { value } setValue(v) { - this.value = v + me.value = v } getValue() { - return this.value + return me.value } } @@ -295,27 +292,27 @@ mod integration_tests { fn test_nested_method_calls() { let code = r#" box Wrapper { - inner + init { inner } setInner(value) { - this.inner = value + me.inner = value } getInner() { - return this.inner + return me.inner } } box Container { - wrapper + init { wrapper } createWrapper() { - this.wrapper = new Wrapper() - return this.wrapper + me.wrapper = new Wrapper() + return me.wrapper } getWrapper() { - return this.wrapper + return me.wrapper } } @@ -359,10 +356,10 @@ mod integration_tests { // 元のdebug_this_problem.nyashと同等のテスト let code = r#" box TestBox { - value + init { value } getValue() { - return this.value + return me.value } }