From 45a913fdc87c0482b616985549e90b76587b63f6 Mon Sep 17 00:00:00 2001 From: Tom Pridham Date: Mon, 20 Jan 2025 13:31:34 -0700 Subject: [PATCH] chore: add object prop shorthand missing comma test --- src/wasm-lib/kcl/src/parsing/parser.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/wasm-lib/kcl/src/parsing/parser.rs b/src/wasm-lib/kcl/src/parsing/parser.rs index 9d5b097835..e94719bf8b 100644 --- a/src/wasm-lib/kcl/src/parsing/parser.rs +++ b/src/wasm-lib/kcl/src/parsing/parser.rs @@ -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 }";