echo("Oraset B-5 扩展功能测试");
echo("=========================");

echo("");
echo("=== 位运算符测试 ===");
let a = 5;
let b = 3;
echo("a & b =", a & b);
echo("a | b =", a | b);
echo("a ^ b =", a ^ b);
let not_a = ~a;
echo("~a =", not_a);
echo("a << 1 =", a << 1);
echo("a >> 1 =", a >> 1);

echo("");
echo("=== switch语句测试 ===");
let x = 2;
switch (x) {
    case 1: echo("x = 1"); break;
    case 2: echo("x = 2"); break;
    case 3: echo("x = 3"); break;
}

echo("");
echo("=== sizeof测试 ===");
let s = "Hello World";
echo("sizeof(s) =", sizeof(s));

echo("");
echo("=== while循环测试 ===");
let i = 0;
while (i < 3) {
    echo("i =", i);
    i++;
}

echo("");
echo("=== 内置函数测试 ===");
let str1 = "Hello";
let str2 = "World";
echo("strcmp:", strcmp(str1, str2));
echo("strcmp same:", strcmp(str1, str1));

echo("");
echo("=== continue测试 ===");
let j = 0;
while (j < 5) {
    j++;
    if (j == 3) continue;
    echo("j =", j);
}

echo("");
echo("=== break测试 ===");
let k = 0;
while (k < 5) {
    if (k == 3) break;
    echo("k =", k);
    k++;
}

echo("");
echo("测试完成!");