Bug 489269

Summary: Math chaining is broken
Product: [Applications] kcalc Reporter: Mark <markg85>
Component: generalAssignee: Evan Teran <evan.teran>
Status: RESOLVED UPSTREAM    
Severity: normal CC: gabriel.barrantes.dev
Priority: NOR    
Version: 24.05.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Mark 2024-06-27 00:19:37 UTC
SUMMARY
type 1+1 <enter> then +1. Result = 1. Seriously!

STEPS TO REPRODUCE
1. type 1+1
2. enter
3. type +1

OBSERVED RESULT
1

EXPECTED RESULT
3

ADDITIONAL INFORMATION
I'm expecting the (completely unnecessary) restyle to have broken this.
Comment 1 Mark 2024-06-27 00:24:45 UTC
And closed... The current git version doesn't have this bug.
Comment 2 Gabriel Barrantes 2024-06-27 01:13:58 UTC
(In reply to Mark from comment #1)
> And closed... The current git version doesn't have this bug.
Thanks.
Comment 3 Mark 2024-08-17 13:29:24 UTC
To amend. I just went over the code a little and i did notice you have testcases. It is probably smart to add a testcase that tests for this kind of math chaining (with enters in between). All current tests, as far as i understand them, seem to be solving just one sum and checking it's output.
Comment 4 Gabriel Barrantes 2024-08-19 15:06:40 UTC
(In reply to Mark from comment #3)
> To amend. I just went over the code a little and i did notice you have
> testcases. It is probably smart to add a testcase that tests for this kind
> of math chaining (with enters in between). All current tests, as far as i
> understand them, seem to be solving just one sum and checking it's output.

Already done in https://invent.kde.org/utilities/kcalc/-/blob/master/appiumtests/chain_results_test.py?ref_type=heads