FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Implement Number IsInt, IsUint, IsFloat, IsNan · Issue #155 · gavv/httpexpect · GitHub

Implement Number IsInt, IsUint, IsFloat, IsNan #155

Description

Implement new Number assertions:

  • IsInt - succeeds if number is signed or unsigned integer (does not have fractional part)
  • IsUint - succeeds if number is unsigned integer (does not have fractional part and is >= 0)
  • IsFloat - succeeds if number is not integer (have fractional part, is opposite to IsInt)
  • IsNan - succeeds if number is NaN

Each of them, except IsNan, should have optional argument bits which defines maximum allowed bitness for the number, e.g. IsInt(32) means that the number should fit in 32-bit signed integer. See String.AsNumber for en example of optional argument.

For every assertion, also add negative version (NotInt, NotUint, etc).

Each assertion should have documentation comment with example and be covered by unit tests. Don't forget to cover corner cases like NaN, inf, etc.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL