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:
37
tests/development/test_modulo_simple_main.hako
Normal file
37
tests/development/test_modulo_simple_main.hako
Normal file
@ -0,0 +1,37 @@
|
||||
// 🧪 % Modulo Operator Test - Simple functionality verification
|
||||
|
||||
static box Main {
|
||||
init { console }
|
||||
|
||||
main() {
|
||||
me.console = new ConsoleBox()
|
||||
me.console.log("🧪 Testing % Modulo Operator")
|
||||
|
||||
// Test 1: Basic modulo operation
|
||||
local result1 = 10 % 3
|
||||
me.console.log("10 % 3 = " + result1)
|
||||
|
||||
// Test 2: Chip-8 style bit masking
|
||||
local result2 = 4096 % 4096
|
||||
me.console.log("4096 % 4096 = " + result2)
|
||||
|
||||
// Test 3: Another typical case
|
||||
local result3 = 256 % 16
|
||||
me.console.log("256 % 16 = " + result3)
|
||||
|
||||
// Test 4: Common modulo pattern
|
||||
local result4 = 17 % 5
|
||||
me.console.log("17 % 5 = " + result4)
|
||||
|
||||
// Check results
|
||||
if result1 == 1 and result2 == 0 and result3 == 0 and result4 == 2 {
|
||||
me.console.log("✅ % Modulo operator test SUCCESSFUL!")
|
||||
} else {
|
||||
me.console.log("❌ % Modulo operator test FAILED!")
|
||||
me.console.log("Expected: 1, 0, 0, 2")
|
||||
me.console.log("Got: " + result1 + ", " + result2 + ", " + result3 + ", " + result4)
|
||||
}
|
||||
|
||||
return "Modulo test complete"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user