Skip to content

Fix comparisons between non-nil values and nil #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2025
Merged

Conversation

gwynne
Copy link
Member

@gwynne gwynne commented Apr 17, 2025

These changes are now available in 1.13.1

The changes in #135 introduced a nasty bug where conditions of the form #if (value == nil) or #if (value != nil) would incorrectly treat nil as equal to any non-nil value. Unfortunately, there was no test for this case, so the problem was not caught. This fixes the issue and adds the missing test.

…incorrectly treated as equal. Adds test for the issue.
@gwynne gwynne added bug Something isn't working semver-patch Internal changes only labels Apr 17, 2025
@gwynne gwynne requested review from 0xTim, MahdiBM and ptoffy April 17, 2025 22:36
Copy link

codecov bot commented Apr 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.78%. Comparing base (73f4ad4) to head (0df0f64).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #138      +/-   ##
==========================================
- Coverage   80.84%   80.78%   -0.06%     
==========================================
  Files          25       25              
  Lines        2678     2665      -13     
==========================================
- Hits         2165     2153      -12     
+ Misses        513      512       -1     
Files with missing lines Coverage Δ
Sources/LeafKit/LeafData/LeafData.swift 62.23% <100.00%> (+0.30%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gwynne gwynne merged commit cf186d8 into main Apr 17, 2025
33 of 39 checks passed
@gwynne gwynne deleted the fix-nil-compare branch April 17, 2025 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working semver-patch Internal changes only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants