Skip to content

Add unit tests for SetLiteral node#1122

Closed
BonnieZ-data wants to merge 3 commits into
wordplaydev:mainfrom
BonnieZ-data:add-setliteral-unit-tests
Closed

Add unit tests for SetLiteral node#1122
BonnieZ-data wants to merge 3 commits into
wordplaydev:mainfrom
BonnieZ-data:add-setliteral-unit-tests

Conversation

@BonnieZ-data
Copy link
Copy Markdown
Contributor

@BonnieZ-data BonnieZ-data commented May 14, 2026

Context

SetLiteral is a core node in the Wordplay language with no unit test coverage. This PR adds tests to verify that set literals evaluate correctly.

Tests Added

  • Set literal with one element
  • Set literal with multiple elements
  • Set literal with string elements
  • Set literal removes duplicate elements
  • Set size via .size()
  • Set is not equal to empty set
  • Set is not empty
  • Set union combines two sets
  • Set intersection finds common elements
  • Set difference removes elements

Why

SetLiteral had zero unit tests despite being a fundamental data structure in Wordplay. These tests ensure correct behavior and protect against regressions.

Related issues

Copy link
Copy Markdown
Collaborator

@amyjko amyjko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the e2e test from this PR; it's unrelated to the PR scope.

@BonnieZ-data
Copy link
Copy Markdown
Contributor Author

Hi @amyjko , thanks for the feedback! I've moved the e2e test to a separate PR and created a clean branch with only the SetLiteral unit tests. Closing this and opening a new PR from the correct branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit tests for SetLiteral node

2 participants