Skip to content

Wordy tests require non-meaningful error messages #3859

@Garrukh

Description

@Garrukh

Hey,
Just recently I got stuck on the Wordy exercise due to what seems like some quite arbitrary error requirements.

Largely the syntax of a correctly formed sentence seems to match the following regex:
^What is( (\d+ [+-*/]))* \d+?$

How come a value like "Who is the President of the United States?" is supposed to raise ValueError("unknown operation") when the syntax of the whole sentence mismatches a correctly formed question. It seems like a ValueError("syntax error") would be more fitting here.

Additionally we could argue the same for the "What is 52 cubed?". You could pose this question in a way that aligns with the syntax more using a statement like "What is 52 to power of 2". This way we could keep the syntax like and avoid having to use so many exceptions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions