()
| 1327 | |
| 1328 | #[test] |
| 1329 | fn test_parse_args() { |
| 1330 | let args = vec![ |
| 1331 | "str_val=hello".to_string(), |
| 1332 | "int_val=42".to_string(), |
| 1333 | "float_val=3.14".to_string(), |
| 1334 | "bool_true=true".to_string(), |
| 1335 | "bool_false=False".to_string(), |
| 1336 | "null_val=null".to_string(), |
| 1337 | ]; |
| 1338 | let parsed = parse_args(&args, &[]).unwrap(); |
| 1339 | let obj = parsed.as_object().unwrap(); |
| 1340 | assert_eq!(obj.get("str_val").unwrap().as_str().unwrap(), "hello"); |
| 1341 | assert_eq!(obj.get("int_val").unwrap().as_i64().unwrap(), 42); |
| 1342 | assert_eq!(obj.get("float_val").unwrap().as_f64().unwrap(), 3.14); |
| 1343 | assert_eq!(obj.get("bool_true").unwrap().as_bool().unwrap(), true); |
| 1344 | assert!(obj.get("null_val").unwrap().is_null()); |
| 1345 | assert_eq!(obj.get("bool_false").unwrap().as_bool().unwrap(), false); |
| 1346 | } |
| 1347 | |
| 1348 | #[test] |
| 1349 | fn test_parse_args_preserves_leading_zeros() { |
nothing calls this directly
no test coverage detected