Skip to content

Commit

Permalink
chore: add object prop shorthand missing comma test
Browse files Browse the repository at this point in the history
  • Loading branch information
TomPridham authored and jtran committed Jan 31, 2025
1 parent 7e1e29a commit 45a913f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/wasm-lib/kcl/src/parsing/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4519,6 +4519,23 @@ sketch001 = startSketchOn('XZ') |> startProfileAt([90.45 119.09], %)"#;
);
}

#[test]
fn test_parse_object_shorthand_missing_comma() {
let some_program_string = r#"
bar = 1
{
foo = bar,
bar
bat = man
}"#;

assert_err(
some_program_string,
"Object is missing a comma in between properties",
[54, 89],
);
}

#[test]
fn warn_object_expr() {
let some_program_string = "{ foo: bar }";
Expand Down

0 comments on commit 45a913f

Please sign in to comment.