Remove some deprecated functions from std (#6531)

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-04-29 12:24:18 +12:00
committed by GitHub
parent 8867258e47
commit aca5fdb521
60 changed files with 3632 additions and 4759 deletions

View File

@ -1295,20 +1295,6 @@ mod tests {
);
}
#[tokio::test(flavor = "multi_thread")]
async fn test_warn_on_deprecated() {
let text = "p = pi()";
let result = parse_execute(text).await.unwrap();
let errs = result.exec_state.errors();
assert_eq!(errs.len(), 1);
assert_eq!(errs[0].severity, crate::errors::Severity::Warning);
assert!(
errs[0].message.contains("`pi` is deprecated"),
"unexpected warning message: {}",
errs[0].message
);
}
#[tokio::test(flavor = "multi_thread")]
async fn test_execute_fn_definitions() {
let ast = r#"fn def = (x) => {
@ -1777,67 +1763,6 @@ let shape = layer() |> patternTransform(instances = 10, transform = transform)
);
}
#[tokio::test(flavor = "multi_thread")]
async fn test_unit_default() {
let ast = r#"const inMm = fromMm(25.4)
const inInches = fromInches(1)"#;
let result = parse_execute(ast).await.unwrap();
assert_eq!(
25.4,
mem_get_json(result.exec_state.stack(), result.mem_env, "inMm")
.as_f64()
.unwrap()
);
assert_eq!(
25.4,
mem_get_json(result.exec_state.stack(), result.mem_env, "inInches")
.as_f64()
.unwrap()
);
}
#[tokio::test(flavor = "multi_thread")]
async fn test_unit_overriden() {
let ast = r#"@settings(defaultLengthUnit = inch)
const inMm = fromMm(25.4)
const inInches = fromInches(1)"#;
let result = parse_execute(ast).await.unwrap();
assert_eq!(
1.0,
mem_get_json(result.exec_state.stack(), result.mem_env, "inMm")
.as_f64()
.unwrap()
.round()
);
assert_eq!(
1.0,
mem_get_json(result.exec_state.stack(), result.mem_env, "inInches")
.as_f64()
.unwrap()
);
}
#[tokio::test(flavor = "multi_thread")]
async fn test_unit_overriden_in() {
let ast = r#"@settings(defaultLengthUnit = in)
const inMm = fromMm(25.4)
const inInches = fromInches(2)"#;
let result = parse_execute(ast).await.unwrap();
assert_eq!(
1.0,
mem_get_json(result.exec_state.stack(), result.mem_env, "inMm")
.as_f64()
.unwrap()
.round()
);
assert_eq!(
2.0,
mem_get_json(result.exec_state.stack(), result.mem_env, "inInches")
.as_f64()
.unwrap()
);
}
#[tokio::test(flavor = "multi_thread")]
async fn test_zero_param_fn() {
let ast = r#"const sigmaAllow = 35000 // psi