Skip to content

test(language/lint): add unit tests for expression-validation pass - #90

Merged
monga-puneet merged 1 commit into
salesforce:mainfrom
dsorajisto:test-expression-validation-lint-pass
Oct 9, 2026
Merged

monga-puneet merged 1 commit into
salesforce:mainfrom
dsorajisto:test-expression-validation-lint-pass

Conversation

@dsorajisto

Copy link
Copy Markdown
Contributor

What

Adds unit tests for packages/language/src/lint/expression-validation.ts, which had no direct tests. 17 tests, following the same pattern as the empty-block (#48) and unreachable-code (#65) tests.

Coverage

  • Function calls: built-ins accepted; unknown names flagged with a suggestion; arity violations (exact and variadic); method calls (namespace-function-call) and indirect calls (indirect-function-call)
  • Namespaced functions: allowed call, unknown function in a known namespace, unknown namespace
  • Operators: supported set, unsupported operator, custom supportedOperators
  • Options: custom name-only functions set
  • @system_variables.uploaded_files: bare dot and bracket references flagged; indexed, sliced and len() uses allowed; slicing @system_variables itself flagged

Each test also asserts that the input parsed with no syntax errors, so a grammar change can't make a "no diagnostic" test pass for the wrong reason.

Testing

pnpm vitest run in packages/language: 30 files, 324 tests pass.

@monga-puneet
monga-puneet merged commit 1639608 into salesforce:main Oct 9, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants