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:
43
local_tests/test_datetime_box.hako
Normal file
43
local_tests/test_datetime_box.hako
Normal file
@ -0,0 +1,43 @@
|
||||
// test_datetime_box.hako - DateTimeBox functionality test
|
||||
// Phase 3: DateTimeBox implementation validation
|
||||
|
||||
print("📅 Testing DateTimeBox implementation...")
|
||||
|
||||
// Basic DateTimeBox creation
|
||||
local now, timestamp_dt, parsed_dt, result
|
||||
|
||||
// Test 1: Current time creation
|
||||
now = new DateTimeBox()
|
||||
print("Current time: " + now.toString())
|
||||
|
||||
// Test 2: Timestamp creation
|
||||
timestamp_dt = new DateTimeBox(1640995200) // 2022-01-01 00:00:00 UTC
|
||||
print("From timestamp: " + timestamp_dt.toString())
|
||||
|
||||
// Test 3: Date component extraction
|
||||
result = now.year()
|
||||
print("Current year: " + result.toString())
|
||||
|
||||
result = now.month()
|
||||
print("Current month: " + result.toString())
|
||||
|
||||
result = now.day()
|
||||
print("Current day: " + result.toString())
|
||||
|
||||
result = now.hour()
|
||||
print("Current hour: " + result.toString())
|
||||
|
||||
result = now.minute()
|
||||
print("Current minute: " + result.toString())
|
||||
|
||||
result = now.second()
|
||||
print("Current second: " + result.toString())
|
||||
|
||||
// Test 4: Date arithmetic
|
||||
result = now.addDays(7)
|
||||
print("7 days from now: " + result.toString())
|
||||
|
||||
result = now.addHours(24)
|
||||
print("24 hours from now: " + result.toString())
|
||||
|
||||
print("✅ DateTimeBox Phase 3 tests completed!")
|
||||
Reference in New Issue
Block a user