Skip to content

This closes #2449, correct blank cell comparisons - #2457

Open
EpicHigh wants to merge 1 commit into
qax-os:masterfrom
EpicHigh:2449-blank-cell-comparisons
Open

EpicHigh wants to merge 1 commit into
qax-os:masterfrom
EpicHigh:2449-blank-cell-comparisons

Conversation

@EpicHigh

Copy link
Copy Markdown
Contributor

Description

Blank cells were converted to numeric zero before every comparison. For a blank A1, this made A1="" return FALSE and A1="0" return TRUE.

Use an empty string when comparing a blank cell with text, FALSE when comparing it with a logical value, and zero otherwise. The change applies to all six comparison operators in either operand order.

Related Issue

Fixes #2449.

How Has This Been Tested

  • The new regression test fails before the fix and passes after it.
  • Tests cover text, numbers, logical values, cell references, IF, error handling, arithmetic, and text joining.
  • go test ./... -count=1 -timeout 20m
  • go test -race ./... -run '^TestCalc' -count=1 -timeout 10m
  • go vet ./...

Tested with Go 1.27.1 on macOS arm64.

A full race-enabled run was also attempted, but the process was killed before completion.

Types of changes

  • Bug fix

@codecov

codecov Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.72%. Comparing base (da3f2df) to head (3ebaf3a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2457   +/-   ##
=======================================
  Coverage   99.72%   99.72%           
=======================================
  Files          32       32           
  Lines       32838    32845    +7     
=======================================
+ Hits        32748    32755    +7     
  Misses         88       88           
  Partials        2        2           
Flag Coverage Δ
unittests 99.72% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@EpicHigh EpicHigh changed the title fix(calc): correct blank cell comparisons fix: this closes #2449, correct blank cell comparisons Oct 18, 2026
@EpicHigh EpicHigh changed the title fix: this closes #2449, correct blank cell comparisons This closes #2449, correct blank cell comparisons Oct 18, 2026
@xuri xuri added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Comparing a blank cell against an empty string returns FALSE

2 participants