depyler-core 3.23.0

Core transpilation engine for the Depyler Python-to-Rust transpiler
Documentation
// Generated by: DEPYLER stdlib validation Phase 1
// Module: sys - Basic system functions
// Status: GREEN phase - Tests enabled

use depyler_core::transpile_python_to_rust;

// DEPYLER-STDLIB-SYS-BASICS-001: Command line arguments
#[test]
fn test_sys_argv() {
    let python = r#"
import sys

def get_args() -> list:
    return sys.argv
"#;

    let result = transpile_python_to_rust(python).expect("Transpilation failed");

    // Should get command line arguments
    assert!(result.contains("args") && result.contains("collect"));
}

// DEPYLER-STDLIB-SYS-BASICS-002: Exit program
#[test]
fn test_sys_exit() {
    let python = r#"
import sys

def exit_program(code: int) -> None:
    sys.exit(code)
"#;

    let result = transpile_python_to_rust(python).expect("Transpilation failed");

    // Should exit with code
    assert!(result.contains("std::process::exit"));
}

// DEPYLER-STDLIB-SYS-BASICS-003: Platform name
#[test]
fn test_sys_platform() {
    let python = r#"
import sys

def get_platform() -> str:
    return sys.platform
"#;

    let result = transpile_python_to_rust(python).expect("Transpilation failed");

    // Should get platform name
    assert!(result.contains("linux") || result.contains("darwin") || result.contains("win32"));
}

// Total: 3 sys module functions implemented
// Coverage: sys.argv, sys.exit(), sys.platform