This commit is contained in:
2025-06-10 04:33:15 -05:00
parent a274fb174f
commit 1c2b8228fe
20 changed files with 957 additions and 294 deletions

32
tests/num_setter_test.ce Normal file
View File

@@ -0,0 +1,32 @@
// Test setter functionality for num.Array
var num = use('num');
// Create an array
var arr = new num.Array([1, 2, 3, 4, 5]);
log.console("Original values:");
log.console("arr[0] =", arr[0], "arr[1] =", arr[1], "arr[2] =", arr[2]);
// Test setting values
arr[0] = 100;
arr[1] = 200;
arr[2] = 300.5;
log.console("After setting:");
log.console("arr[0] =", arr[0], "arr[1] =", arr[1], "arr[2] =", arr[2]);
// Test setting with different types
arr[3] = "123.7"; // Should convert string to number
arr[4] = true; // Should convert boolean to number
log.console("After type conversion:");
log.console("arr[3] =", arr[3], "(from string)");
log.console("arr[4] =", arr[4], "(from boolean)");
// Test bounds checking - this should fail silently
arr[10] = 999;
log.console("arr[10] after out-of-bounds set =", arr[10]);
log.console("Final array:", arr.toArray());
$_.stop();