#[cfg(test)]
mod tests {
    use std::process::Command;
    
    const SCRIPT_PATH: &str = "/Users/einand/Code/test/rust/print_hej";
    
    fn run_script(args: Option<&str>) -> String {
        let mut cmd = Command::new(SCRIPT_PATH);
        if let Some(arg) = args {
            cmd.arg(arg);
        }
        let output = cmd.output().expect("Failed to execute script");
        String::from_utf8_lossy(&output.stdout).trim().to_string()
    }
    
    #[test]
    fn test_10_decimals() {
        let result = run_script(Some("10"));
        let expected = "3.1415926535";
        assert_eq!(result, expected);
    }
    
    #[test]
    fn test_5_decimals() {
        let result = run_script(Some("5"));
        let expected = "3.14159";
        assert_eq!(result, expected);
    }
    
    #[test]
    fn test_1_decimal() {
        let result = run_script(Some("1"));
        let expected = "3.1";
        assert_eq!(result, expected);
    }
    
    #[test]
    fn test_100_decimals() {
        let result = run_script(Some("100"));
        let expected = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679";
        assert_eq!(result, expected);
    }
    
    #[test]
    fn test_default_100_decimals() {
        let result = run_script(None);
        let expected = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679";
        assert_eq!(result, expected);
    }
    
    #[test]
    fn test_10000_decimals() {
        let result = run_script(Some("10000"));
        // Check length: "3." + 10000 digits = 10002 characters
        assert_eq!(result.len(), 10002);
        assert!(result.starts_with("3.14159"));
    }
}