56 lines
1.2 KiB
Plaintext
56 lines
1.2 KiB
Plaintext
|
|
// 特定の引数名テスト
|
||
|
|
|
||
|
|
print("=== Specific Arg Names Test ===")
|
||
|
|
|
||
|
|
box TargetBox {
|
||
|
|
init { name }
|
||
|
|
|
||
|
|
// 元の引数名を使用
|
||
|
|
deliver(messageType, data, from) {
|
||
|
|
print("deliver: " + from + " -> " + messageType + " = " + data)
|
||
|
|
}
|
||
|
|
|
||
|
|
// 一般的な引数名
|
||
|
|
process(a, b, c) {
|
||
|
|
print("process: " + a + ", " + b + ", " + c)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
box CallerBox {
|
||
|
|
init { target, nodeId }
|
||
|
|
|
||
|
|
setup(targetRef) {
|
||
|
|
me.target = targetRef
|
||
|
|
me.nodeId = "TestNode"
|
||
|
|
print("CallerBox setup completed")
|
||
|
|
}
|
||
|
|
|
||
|
|
testGeneric() {
|
||
|
|
print("Testing generic args...")
|
||
|
|
me.target.process("arg1", "arg2", me.nodeId)
|
||
|
|
print("Generic test completed")
|
||
|
|
}
|
||
|
|
|
||
|
|
testSpecific() {
|
||
|
|
print("Testing specific args...")
|
||
|
|
me.target.deliver("hello", "Hi there!", me.nodeId)
|
||
|
|
print("Specific test completed")
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// テスト実行
|
||
|
|
print("Creating boxes...")
|
||
|
|
local target
|
||
|
|
target = new TargetBox()
|
||
|
|
|
||
|
|
local caller
|
||
|
|
caller = new CallerBox()
|
||
|
|
caller.setup(target)
|
||
|
|
|
||
|
|
print("Testing with generic arg names...")
|
||
|
|
caller.testGeneric()
|
||
|
|
|
||
|
|
print("Testing with specific arg names (messageType, data, from)...")
|
||
|
|
caller.testSpecific()
|
||
|
|
|
||
|
|
print("All arg name tests completed!")
|