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:
nyash-codex
2025-11-06 15:41:52 +09:00
parent 2dc370223d
commit 77d4fd72b3
1658 changed files with 6288 additions and 2612 deletions

View File

@ -0,0 +1,44 @@
// Test file for simple_rooms.hako
using "text_adventure/simple_rooms.hako"
print("🏰 Testing Simple Rooms Module...")
// Test 1: Basic room creation
print("\n=== Test 1: Basic Room ===")
testRoom = new Room("Test Room", "A simple test room for debugging.")
print("Room created: " + testRoom.name)
print(testRoom.look())
// Test 2: Adding items to room
print("\n=== Test 2: Room Items ===")
coin = new Item("Gold Coin", "A shiny coin", 1, 50)
testRoom.addItem(coin)
print("After adding coin:")
print(testRoom.look())
// Test 3: Taking items from room
print("\n=== Test 3: Taking Items ===")
takenItem = testRoom.takeItem("Gold Coin")
if takenItem {
takenName = takenItem.name
print("Took: " + takenName)
} else {
print("Failed to take item")
}
print("Room after taking item:")
print(testRoom.look())
// Test 4: Has item check
print("\n=== Test 4: Item Existence ===")
sword = createSword()
testRoom.addItem(sword)
print("Has Iron Sword: " + testRoom.hasItem("Iron Sword"))
print("Has Gold Coin: " + testRoom.hasItem("Gold Coin"))
// Test 5: World creation
print("\n=== Test 5: Simple World ===")
startRoom = createSimpleWorld()
print("World created! Starting room:")
print(startRoom.look())
print("\n✅ Simple Rooms module test completed!")