from core.obfuscator import obfuscate

code = """
local a = 10
local b = 20
local c = a + b
print("Sum is:", c)
"""

obfuscated = obfuscate(code)
print(obfuscated)

# Check for some patterns
if "_l1" in obfuscated or "_I0" in obfuscated:
    print("SUCCESS: Variable renaming detected.")
if "bit32.bxor" in obfuscated or "+" in obfuscated or "-" in obfuscated:
    # Check if it's in the VM logic, not just the original code (which might have +)
    # The VM logic uses to_expr for indices and keys.
    print("SUCCESS: Number expressions detected.")
if "math.pi" in obfuscated or "math.sqrt" in obfuscated:
    print("SUCCESS: Opaque predicates detected.")
