61 lines
2.1 KiB
Plaintext
61 lines
2.1 KiB
Plaintext
// SocketBox状態保持問題テスト - Phase 9.75-B修正検証
|
||
// PR #89修正後のSocketBox状態永続化テスト
|
||
|
||
static box Main {
|
||
init { console, result }
|
||
|
||
main() {
|
||
me.console = new ConsoleBox()
|
||
me.console.log("🔧 SocketBox状態保持テスト開始")
|
||
|
||
// SocketBox作成
|
||
local server
|
||
server = new SocketBox()
|
||
me.console.log("✅ SocketBox作成完了")
|
||
|
||
// bind操作 - 状態設定
|
||
local bindResult
|
||
bindResult = server.bind("127.0.0.1", "8080")
|
||
me.console.log("🔥 bind結果: " + bindResult.toString())
|
||
|
||
// 重要テスト:isServer()状態確認
|
||
local isServerBefore
|
||
isServerBefore = server.isServer()
|
||
me.console.log("🔥 bind後のisServer(): " + isServerBefore.toString())
|
||
|
||
// toString()テスト
|
||
local socketString
|
||
socketString = server.toString()
|
||
me.console.log("🔥 server.toString(): " + socketString)
|
||
|
||
// 再度isServer()確認 - 状態永続性テスト
|
||
local isServerAfter
|
||
isServerAfter = server.isServer()
|
||
me.console.log("🔥 2回目のisServer(): " + isServerAfter.toString())
|
||
|
||
// listen()テスト
|
||
local listenResult
|
||
listenResult = server.listen("10")
|
||
me.console.log("🔥 listen結果: " + listenResult.toString())
|
||
|
||
// 最終状態確認
|
||
local finalState
|
||
finalState = server.isServer()
|
||
me.console.log("🔥 最終isServer(): " + finalState.toString())
|
||
|
||
// 期待結果確認
|
||
if finalState.toString() == "true" {
|
||
me.console.log("🎉 SocketBox状態保持問題修正確認!")
|
||
me.result = "SUCCESS: SocketBox状態が正常に保持されています"
|
||
} else {
|
||
me.console.log("❌ SocketBox状態保持問題が残存")
|
||
me.result = "FAILED: SocketBox状態が失われています"
|
||
}
|
||
|
||
// クリーンアップ
|
||
server.close()
|
||
me.console.log("✅ テスト完了")
|
||
|
||
return me.result
|
||
}
|
||
} |