phase: 20.49 COMPLETE; 20.50 Flow+String minimal reps; 20.51 selfhost v0/v1 minimal (Option A/B); hv1-inline binop/unop/copy; docs + run_all + CURRENT_TASK -> 21.0
This commit is contained in:
31
local_tests/test_state_sharing_validation.hako
Normal file
31
local_tests/test_state_sharing_validation.hako
Normal file
@ -0,0 +1,31 @@
|
||||
// 🎯 Phase B-C 验证测试 - 确认状态共享修复是否有效
|
||||
static box Main {
|
||||
init { array_test, map_test, buffer_test, socket_test }
|
||||
main() {
|
||||
// ArrayBox测试
|
||||
local arr
|
||||
arr = new ArrayBox()
|
||||
arr.push("hello")
|
||||
me.array_test = arr.length() // 期待: 1
|
||||
|
||||
// MapBox测试
|
||||
local map
|
||||
map = new MapBox()
|
||||
map.set("key1", "value1")
|
||||
me.map_test = map.size() // 期待: 1
|
||||
|
||||
// BufferBox测试
|
||||
local buf
|
||||
buf = new BufferBox()
|
||||
buf.write([72, 101, 108, 108, 111]) // "Hello"
|
||||
me.buffer_test = buf.length() // 期待: 5
|
||||
|
||||
// SocketBox测试
|
||||
local sock
|
||||
sock = new SocketBox()
|
||||
sock.bind("127.0.0.1", 8080)
|
||||
me.socket_test = 1 // 暂时设为1,表示创建成功
|
||||
|
||||
return me.array_test
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user