Brackets Function #25
Labels
No labels
blocked
duplicate
needs
approval
needs
criteria
needs
estimate
needs
tests
question
type
admin
type
alert
type
bug
type
change
type
defect
type
dependencies
type
epic
type
idea
type
incident
type
investigation
type
spike
type
story
won't fix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
RabbitLabs/calculator#25
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Epic: #21
Story Points:
AS a user, I want expressions with brackets to be evaluated correctly
SO THAT I can control the order of operations in multi-operation expressions
Acceptance Criteria
GIVEN #22 (multiple operations in one expression) is complete
WHEN I evaluate an expression containing brackets in CLI interactive mode
THEN bracketed sub-expressions are solved before the surrounding operations
GIVEN #22 is complete
WHEN I evaluate
(2 + 3) * 4THEN the result is
20GIVEN #22 is complete
WHEN I evaluate
2 + (3 * 4)THEN the result is
14GIVEN #22 is complete
WHEN I evaluate a nested bracketed expression such as
((2 + 3) * 2) - 1THEN each inner bracketed group is solved before outer operations and the result is
9GIVEN #22 is complete
WHEN I evaluate an expression with optional spaces such as
( 2 + 3 ) * 4THEN spaces are ignored and the result matches
(2 + 3) * 4GIVEN #22 is complete
WHEN I evaluate an expression with unclosed or unmatched brackets such as
(2 + 3or2 + 3)or((2 + 3)THEN a clear error message is shown and no result is produced
GIVEN #22 is complete
WHEN I run
calculator cli "(2 + 3) * 4"(single-expression mode)THEN
20is printed to stdoutGIVEN I am in GUI mode
WHEN I evaluate an expression containing brackets
THEN bracketed sub-expressions are solved before the surrounding operations, consistent with CLI behaviour
Subtasks
()Notes
Blocked by #22