Files
hakorune/local_tests/test_pack_transparency_final.hako

61 lines
1.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 🔥 Phase 8.8: pack透明化システム 最終統合テスト
# 全機能の協調動作確認
print("=== pack透明化システム最終統合テスト開始 ===")
# 1. 従来のbirth機能ユーザー定義Box
box Animal {
init { name, species }
birth(animalName, animalSpecies) {
me.name = animalName
me.species = animalSpecies
}
introduce() {
return me.name + " は " + me.species + " です"
}
}
# 2. pack透明化ビルトインBox継承
box SmartString from StringBox {
init { metadata }
birth(content, meta) {
from StringBox(content) # 透明化
me.metadata = meta
}
getInfo() {
return "内容の情報: " + me.metadata
}
}
# 3. 複数のビルトインBox透明化
box Calculator from MathBox {
init { precision }
birth(precisionLevel) {
from MathBox.birth() # Explicit syntax after Phase 8.9
me.precision = precisionLevel
}
getPrecision() {
return "精度: " + me.precision
}
}
# テスト実行
print("1. ユーザー定義Box:")
local cat = new Animal("ミケ", "猫")
print(cat.introduce())
print("2. StringBox透明化:")
local smartStr = new SmartString("Hello World", "UTF-8")
print(smartStr.getInfo())
print("3. MathBox透明化:")
local calc = new Calculator("高精度")
print(calc.getPrecision())
print("=== 全テスト成功pack透明化システム完了 ===")テム完了 ===")