Skip to content

Signed Numbers Not Supported for Numeric Input #22

@sy-python

Description

@sy-python

Description: Trying to parse numeric input when the number has a sign (e.g. -5, +6) leads to ShakespeareRuntimeError

Sample Play:

The Folly Of The Writer, a tragedy in one act.

Romeo, Determined to expose every single mistake.  
Juliet, His ever-faithful companion.

Act I: The Error Begins.  
Scene I: A Sign Of Disaster.

[Enter Romeo and Juliet]

Romeo: Listen to your heart. Open your heart.

Expected Behaviour:
The program should correctly interpret signed numbers as valid input. When running the sample play with the following inputs, the expected outputs should be:

Input: 23
Output: 23

Input: -6
Output: -6

Input: +9
Output: 9

Actual Behaviour:
The program handles unsigned numbers correctly, but fails when parsing signed numbers, raising a ShakespeareRuntimeError. The following happens:

Input: 23
Output: 23

Input: -6
Error Raised: ShakespeareRuntimeError: No numeric input was given.

Input: +9
Error Raised: ShakespeareRuntimeError: No numeric input was given.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions