Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stdlib] Add missing comparison operator tests #3145

Closed
4 tasks done
laszlokindrat opened this issue Jun 28, 2024 · 3 comments
Closed
4 tasks done

[stdlib] Add missing comparison operator tests #3145

laszlokindrat opened this issue Jun 28, 2024 · 3 comments
Labels
good first issue Good for newcomers

Comments

@laszlokindrat
Copy link
Contributor

laszlokindrat commented Jun 28, 2024

The following types are missing tests for the operators required by the Comparable trait (__le__, __ge__, etc.):

We should also ensure they have tests for __eq__ and __ne__. Keep in mind that dunder methods should be tested directly (i.e. not through operator syntax sugar) for these basic numeric types to avoid unintended implicit conversions.:

@laszlokindrat laszlokindrat added the good first issue Good for newcomers label Jun 28, 2024
modularbot added a commit that referenced this issue Jul 10, 2024
Added unit tests for `__lt__`, `__le__`, `__eq__`, `__ne__`, `__gt__`,
and `__ge__` dunders of `Int`.

Related to #3145

ORIGINAL_AUTHOR=Matvey Fedoseev
<41521530+MatveyF@users.noreply.github.com>
PUBLIC_PR_LINK=#3161

Co-authored-by: Matvey Fedoseev <41521530+MatveyF@users.noreply.github.com>
Closes #3161
MODULAR_ORIG_COMMIT_REV_ID: 12875e85edc971dcd61913293988525cf7c19c71
vguerra added a commit to vguerra/mojo that referenced this issue Jul 10, 2024
…y `Comparable`

Testing the following dunder methods in `IntLiteral`: `__lt__`, `__le__`, `__eq__`,
`__ne__`, `__gt__` and `__ge__`. Note that we test directly dunder methods to avoid
any uninteded implicit convertions possibly introduced trough operator syntax sugar.

Partially resolves modularml#3145.
martinvuyk pushed a commit to martinvuyk/mojo that referenced this issue Jul 10, 2024
Added unit tests for `__lt__`, `__le__`, `__eq__`, `__ne__`, `__gt__`,
and `__ge__` dunders of `Int`.

Related to modularml#3145

ORIGINAL_AUTHOR=Matvey Fedoseev
<41521530+MatveyF@users.noreply.github.com>
PUBLIC_PR_LINK=modularml#3161

Co-authored-by: Matvey Fedoseev <41521530+MatveyF@users.noreply.github.com>
Closes modularml#3161
MODULAR_ORIG_COMMIT_REV_ID: 12875e85edc971dcd61913293988525cf7c19c71

Signed-off-by: martinvuyk <martin.vuyklop@gmail.com>
vguerra added a commit to vguerra/mojo that referenced this issue Jul 11, 2024
…y `Comparable`

Testing the following dunder methods in `IntLiteral`: `__lt__`, `__le__`, `__eq__`,
`__ne__`, `__gt__` and `__ge__`. Note that we test directly dunder methods to avoid
any uninteded implicit convertions possibly introduced trough operator syntax sugar.

Partially resolves modularml#3145.
vguerra added a commit to vguerra/mojo that referenced this issue Jul 11, 2024
…y `Comparable`

Testing the following dunder methods in `IntLiteral`: `__lt__`, `__le__`, `__eq__`,
`__ne__`, `__gt__` and `__ge__`. Note that we test directly dunder methods to avoid
any unintended implicit conversions possibly introduced trough operator syntax sugar.

Partially resolves modularml#3145.
vguerra added a commit to vguerra/mojo that referenced this issue Jul 11, 2024
…y `Comparable`

Testing the following dunder methods in `IntLiteral`: `__lt__`, `__le__`, `__eq__`,
`__ne__`, `__gt__` and `__ge__`. Note that we test directly dunder methods to avoid
any unintended implicit conversions possibly introduced trough operator syntax sugar.

Partially resolves modularml#3145.
vguerra added a commit to vguerra/mojo that referenced this issue Jul 11, 2024
…y `Comparable`

Testing the following dunder methods in `IntLiteral`: `__lt__`, `__le__`, `__eq__`,
`__ne__`, `__gt__` and `__ge__`. Note that we test directly dunder methods to avoid
any unintended implicit conversions possibly introduced trough operator syntax sugar.

Partially resolves modularml#3145.

Signed-off-by: vm.guerramoran <vm.guerramoran@criteo.com>
vguerra added a commit to vguerra/mojo that referenced this issue Jul 11, 2024
…y `Comparable`

Testing the following dunder methods in `IntLiteral`: `__lt__`, `__le__`, `__eq__`,
`__ne__`, `__gt__` and `__ge__`. Note that we test directly dunder methods to avoid
any unintended implicit conversions possibly introduced trough operator syntax sugar.

Partially resolves modularml#3145.

Signed-off-by: Victor Guerra <vguerra@gmail.com>
vguerra added a commit to vguerra/mojo that referenced this issue Jul 11, 2024
Testing the following dunder methods in `IntLiteral`: `__lt__`, `__le__`, `__eq__`,
`__ne__`, `__gt__` and `__ge__`. Note that we test directly dunder methods to avoid
any unintended implicit conversions possibly introduced trough operator syntax sugar.

Partially resolves modularml#3145.

Signed-off-by: Victor Guerra <vguerra@gmail.com>
vguerra added a commit to vguerra/mojo that referenced this issue Jul 11, 2024
Testing the following dunder methods in `FloatLiteral`: `__lt__`, `__le__`, `__eq__`,
`__ne__`, `__gt__` and `__ge__`. Note that we test directly dunder methods to avoid
any unintended implicit conversions possibly introduced trough operator syntax sugar.

Partially resolves modularml#3145

Signed-off-by: Victor Guerra <vguerra@gmail.com>
vguerra added a commit to vguerra/mojo that referenced this issue Jul 11, 2024
Testing the following dunder methods in `SIMD`: `__lt__`, `__le__`, `__eq__`,
`__ne__`, `__gt__` and `__ge__`. Note that we test directly dunder methods to avoid
any unintended implicit conversions possibly introduced trough operator syntax sugar.

Partially resolves modularml#3145

Signed-off-by: Victor Guerra <vguerra@gmail.com>
@vguerra
Copy link
Contributor

vguerra commented Jul 11, 2024

hello @laszlokindrat , just wanted to let you know that I pushed a couple of PRs to address the tasks in this issue: #3214 , #3216 and #3221

modularbot pushed a commit that referenced this issue Jul 17, 2024
…Comparable` (#43484)

[External] [stdlib] UTests for `IntLiteral`'s operators required by
`Comparable`

Testing the following dunder methods in `IntLiteral`: `__lt__`,
`__le__`, `__eq__`, `__ne__`, `__gt__` and `__ge__`. Note that we test
directly dunder methods to avoid any unintended implicit conversions
possibly introduced trough operator syntax sugar.

Partially resolves #3145.

Co-authored-by: Victor Guerra <vguerra@gmail.com>
Closes #3214
MODULAR_ORIG_COMMIT_REV_ID: d516752f3b9dce381e8b7b164b8e1a56054dbc0c
modularbot pushed a commit that referenced this issue Jul 17, 2024
… `Comparable` (#43485)

[External] [stdlib] UTests for `FloatLiteral`'s operators required by
`Comparable`

Testing the following dunder methods in `FloatLiteral`: `__lt__`,
`__le__`, `__eq__`, `__ne__`, `__gt__` and `__ge__`. Note that we test
directly dunder methods to avoid any unintended implicit conversions
possibly introduced trough operator syntax sugar.

Partially resolves #3145

Co-authored-by: Victor Guerra <vguerra@gmail.com>
Closes #3216
MODULAR_ORIG_COMMIT_REV_ID: fc13864bfb0e4ffd5152f9a4af9940722933b4ab
modularbot pushed a commit that referenced this issue Jul 23, 2024
…able` (#43826)

[External] [stdlib] UTests for `SIMD`'s operators required by
`Comparable`

Testing the following dunder methods in `SIMD`: `__lt__`, `__le__`,
`__eq__`, `__ne__`, `__gt__` and `__ge__`. Note that we test directly
dunder methods to avoid any unintended implicit conversions possibly
introduced trough operator syntax sugar.

Partially resolves #3145

Co-authored-by: Victor Guerra <vguerra@gmail.com>
Closes #3221
MODULAR_ORIG_COMMIT_REV_ID: 55ece3450c8b074ae3279f79cec8aa642382b036
@laszlokindrat
Copy link
Contributor Author

This is now complete thanks to @MatveyF, @vguerra, and @martinvuyk! 🎉

@martinvuyk
Copy link
Contributor

I actually had nothing to do with this lol, just pushed a commit that referenced this during a rebase. Anyhow great work :D

modularbot added a commit that referenced this issue Sep 13, 2024
Added unit tests for `__lt__`, `__le__`, `__eq__`, `__ne__`, `__gt__`,
and `__ge__` dunders of `Int`.

Related to #3145

ORIGINAL_AUTHOR=Matvey Fedoseev
<41521530+MatveyF@users.noreply.github.com>
PUBLIC_PR_LINK=#3161

Co-authored-by: Matvey Fedoseev <41521530+MatveyF@users.noreply.github.com>
Closes #3161
MODULAR_ORIG_COMMIT_REV_ID: 12875e85edc971dcd61913293988525cf7c19c71
modularbot pushed a commit that referenced this issue Sep 13, 2024
…Comparable` (#43484)

[External] [stdlib] UTests for `IntLiteral`'s operators required by
`Comparable`

Testing the following dunder methods in `IntLiteral`: `__lt__`,
`__le__`, `__eq__`, `__ne__`, `__gt__` and `__ge__`. Note that we test
directly dunder methods to avoid any unintended implicit conversions
possibly introduced trough operator syntax sugar.

Partially resolves #3145.

Co-authored-by: Victor Guerra <vguerra@gmail.com>
Closes #3214
MODULAR_ORIG_COMMIT_REV_ID: d516752f3b9dce381e8b7b164b8e1a56054dbc0c
modularbot pushed a commit that referenced this issue Sep 13, 2024
… `Comparable` (#43485)

[External] [stdlib] UTests for `FloatLiteral`'s operators required by
`Comparable`

Testing the following dunder methods in `FloatLiteral`: `__lt__`,
`__le__`, `__eq__`, `__ne__`, `__gt__` and `__ge__`. Note that we test
directly dunder methods to avoid any unintended implicit conversions
possibly introduced trough operator syntax sugar.

Partially resolves #3145

Co-authored-by: Victor Guerra <vguerra@gmail.com>
Closes #3216
MODULAR_ORIG_COMMIT_REV_ID: fc13864bfb0e4ffd5152f9a4af9940722933b4ab
modularbot pushed a commit that referenced this issue Sep 13, 2024
…able` (#43826)

[External] [stdlib] UTests for `SIMD`'s operators required by
`Comparable`

Testing the following dunder methods in `SIMD`: `__lt__`, `__le__`,
`__eq__`, `__ne__`, `__gt__` and `__ge__`. Note that we test directly
dunder methods to avoid any unintended implicit conversions possibly
introduced trough operator syntax sugar.

Partially resolves #3145

Co-authored-by: Victor Guerra <vguerra@gmail.com>
Closes #3221
MODULAR_ORIG_COMMIT_REV_ID: 55ece3450c8b074ae3279f79cec8aa642382b036
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants