Skip to content

Commit

Permalink
Fixup tests
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Cameron <[email protected]>
  • Loading branch information
nrc committed Jan 14, 2025
1 parent eaf996a commit bc0598b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
1 change: 0 additions & 1 deletion docs/kcl/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ layout: manual
* [`hollow`](kcl/hollow)
* [`import`](kcl/import)
* [`inch`](kcl/inch)
* [`int`](kcl/int)
* [`lastSegX`](kcl/lastSegX)
* [`lastSegY`](kcl/lastSegY)
* [`legAngX`](kcl/legAngX)
Expand Down
2 changes: 2 additions & 0 deletions docs/kcl/int.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ excerpt: "Convert a number to an integer."
layout: manual
---

**WARNING:** This function is deprecated.

Convert a number to an integer.

DEPRECATED use floor(), ceil(), or round().
Expand Down
2 changes: 1 addition & 1 deletion docs/kcl/std.json
Original file line number Diff line number Diff line change
Expand Up @@ -87204,7 +87204,7 @@
"labelRequired": true
},
"unpublished": false,
"deprecated": false,
"deprecated": true,
"examples": [
"n = int(ceil(5 / 2))\nassertEqual(n, 3, 0.0001, \"5/2 = 2.5, rounded up makes 3\")\n// Draw n cylinders.\nstartSketchOn('XZ')\n |> circle({ center = [0, 0], radius = 2 }, %)\n |> extrude(5, %)\n |> patternTransform(n, fn(id) {\n return { translate = [4 * id, 0, 0] }\n }, %)"
]
Expand Down
11 changes: 0 additions & 11 deletions src/wasm-lib/kcl/src/parsing/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4328,17 +4328,6 @@ sketch001 = startSketchOn('XZ') |> startProfileAt([90.45, 119.09, %)"#;
assert_eq!(errs[0].apply_suggestion(some_program_string).unwrap(), "{ foo = bar }")
}

#[test]
fn warn_fn_int() {
let some_program_string = r#"int(1.0)
int(42.3)"#;
let (_, errs) = assert_no_err(some_program_string);
assert_eq!(errs.len(), 2);
let replaced = errs[1].apply_suggestion(some_program_string).unwrap();
let replaced = errs[0].apply_suggestion(&replaced).unwrap();
assert_eq!(replaced, "1.0\nround(42.3)");
}

#[test]
fn warn_fn_decl() {
let some_program_string = r#"fn foo = () => {
Expand Down

0 comments on commit bc0598b

Please sign in to comment.