Repository navigation
This closes #2448, fix incorrect equality result for a number and text operand - #2454
Open
PhilflowIO wants to merge 1 commit into
Open
PhilflowIO wants to merge 1 commit into
PhilflowIO wants to merge 1 commit into
Conversation
…nd text operand - Update unit test
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2454 +/- ##
=======================================
Coverage 99.72% 99.72%
=======================================
Files 32 32
Lines 32554 32568 +14
=======================================
+ Hits 32464 32478 +14
Misses 88 88
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Details
Description
Adds the helper
numberTextMismatchand calls it fromcalcEqandcalcNEq. When one operand is a number and the other one is text,=returns FALSE and<>returns TRUE instead of falling through to the comparison of the formatted values.The helper is declared above
calcEqand reads onlyTypeand the logical flag. It is called after the existing text against text branch, sostrings.EqualFoldkeeps handling that case and"a"="A"stays TRUE. A logical value is excluded, it reaches the comparison as a number holding the logical flag and its behaviour is unchanged.Related Issue
Closes #2448
Motivation and Context
rOpd.Value() == lOpd.Value()cannot tell the number 1 from the text "1", because both format to1. Excel 365 (Excel for the web, 16.0300) returns FALSE for1="1"and TRUE for1<>"1". The ordering operators<,<=,>and>=already have the type branches for this; only=and<>were missing them.How Has This Been Tested
Cases added to
TestCalcCellValue:1="1","1"=1,1<>"1",1.5="1.5",100="100",A1="1",A1<>"1",(1="1")*1,IF(1="1","equal","notequal"), plus the unchanged boundaries"a"="A",0="",TRUE=1and the result type assertionsISNUMBER(1="1"),ISLOGICAL(1="1"),ISTEXT(1="1"). The existing expectations for the ordering operators, for text against text and for number against number are unchanged.go test ./...passes on go1.26.9 linux/amd64.go vet ./...is clean andgofmt -s -l .is empty.Types of changes
Checklist