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

[mojo-stdlib] Replace tests using FileCheck with testing module where possible #2024

Closed
1 task done
JoeLoser opened this issue Mar 28, 2024 · 2 comments
Closed
1 task done
Assignees
Labels
good first issue Good for newcomers mojo-repo Tag all issues with this label refactoring Refactoring/clean up of code

Comments

@JoeLoser
Copy link
Collaborator

JoeLoser commented Mar 28, 2024

Review Mojo's priorities

What is your request?

Many tests use FileCheck still which isn't great for many reasons for a standard library. We should move these over to use functions like assert_equal, assert_true, and friends from the testing module where possible.

What is your motivation for this change?

Moving things over to use our testing module helps "eat our own cooking" as we build out the test framework. Additionally, often, the code is much shorter — while still achieving the same intent as the original code.

Any other details?

There are several test files still using FileCheck as can be identified with:

git grep -l '| FileCheck'

I wouldn't worry too much about the examples to start with; in fact, I recommend we fix those last only after we've changed as many of the standard library tests as we can.

Note: if multiple people plan on working on this, please coordinate to avoid two people working in porting the tests over for the same file.

@JoeLoser JoeLoser added enhancement New feature or request mojo Issues that are related to mojo good first issue Good for newcomers mojo-stdlib Tag for issues related to standard library refactoring Refactoring/clean up of code labels Mar 28, 2024
JoeLoser pushed a commit that referenced this issue Apr 15, 2024
Related to #2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>
JoeLoser pushed a commit that referenced this issue Apr 15, 2024
Related to #2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>
JoeLoser pushed a commit that referenced this issue Apr 15, 2024
Related to #2024 

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>
JoeLoser pushed a commit that referenced this issue Apr 15, 2024
Related to #2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>
JoeLoser pushed a commit that referenced this issue Apr 15, 2024
Related to #2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>
JoeLoser pushed a commit that referenced this issue Apr 15, 2024
Related to #2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>
patrickdoc added a commit to patrickdoc/mojo that referenced this issue May 2, 2024
…2283) (#38176)

Related to modularml#2024

Signed-off-by: gabrieldemarmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: 76e4cec

Co-authored-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>
MODULAR_ORIG_COMMIT_REV_ID: 02e32e0b59a23dbf66ad6dc4cbab2d30cff0645d
patrickdoc added a commit to patrickdoc/mojo that referenced this issue May 2, 2024
…larml#2305) (#38180)

Related to modularml#2024

Signed-off-by: gabrieldemarmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: 6b780fa

---------

Co-authored-by: Gabriel de Marmiesse <gabriel.demarmiesse@datadoghq.com>
Co-authored-by: abdul dakkak <adakkak@modular.com>
MODULAR_ORIG_COMMIT_REV_ID: fe023a324baecb605ef3f8cacbc8b521486fb411
patrickdoc added a commit to patrickdoc/mojo that referenced this issue May 2, 2024
…e.mojo` (modularml#2292) (#38181)

Related to modularml#2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: 0663b75

---------

Co-authored-by: Gabriel de Marmiesse <gabriel.demarmiesse@datadoghq.com>
Co-authored-by: abdul dakkak <adakkak@modular.com>
MODULAR_ORIG_COMMIT_REV_ID: 694dde80742a1c96a4db44777917c356f7d97d7f
patrickdoc added a commit to patrickdoc/mojo that referenced this issue May 2, 2024
…ml#2289) (#38185)

Related to modularml#2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: 1187746

---------

Co-authored-by: Gabriel de Marmiesse <gabriel.demarmiesse@datadoghq.com>
Co-authored-by: abdul dakkak <adakkak@modular.com>
MODULAR_ORIG_COMMIT_REV_ID: be39890d33887cc9a2563f3f46ec140df07e1f33
patrickdoc added a commit to patrickdoc/mojo that referenced this issue May 2, 2024
…l#2298) (#38187)

Related to modularml#2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: 8c68d64

---------

Co-authored-by: Gabriel de Marmiesse <gabriel.demarmiesse@datadoghq.com>
Co-authored-by: abdul dakkak <adakkak@modular.com>
MODULAR_ORIG_COMMIT_REV_ID: ec000ee778a6a2e0734f750ca412993c10437edb
patrickdoc added a commit to patrickdoc/mojo that referenced this issue May 2, 2024
…l#2299) (#38188)

Related to modularml#2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: 457378c

Co-authored-by: Gabriel de Marmiesse <gabriel.demarmiesse@datadoghq.com>
MODULAR_ORIG_COMMIT_REV_ID: 58c17994244d682d61acdd20a98ccdbd3524ba21
patrickdoc added a commit to patrickdoc/mojo that referenced this issue May 2, 2024
…l#2350) (#38374)

Related to modularml#2024

Signed-off-by: gabrieldemarmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: 5690d78
MODULAR_ORIG_COMMIT_REV_ID: bf75fa4eab11628cfa2c48ed2211b31656362574
patrickdoc added a commit that referenced this issue May 2, 2024
…) (#38067)

Related to #2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: 4c40ceb

Co-authored-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>
MODULAR_ORIG_COMMIT_REV_ID: 104429a5ee627eeffcebf012e19b11e5ba49fef7
patrickdoc added a commit that referenced this issue May 2, 2024
…2291) (#38065)

Related to #2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: 746c4ae

Co-authored-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>
MODULAR_ORIG_COMMIT_REV_ID: e4268b784bf9a72c1604042387c0bcb7ae13a29f
patrickdoc added a commit that referenced this issue May 2, 2024
…2300) (#38061)

Related to #2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: dd51a48

Co-authored-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>
MODULAR_ORIG_COMMIT_REV_ID: d491ab08da8b6862afb0729a92d970a1da142a8e
patrickdoc added a commit that referenced this issue May 2, 2024
… (#38064)

Related to #2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: da4f739
MODULAR_ORIG_COMMIT_REV_ID: 66e3e16782201af17195d602d10340ae34d149ba
patrickdoc added a commit that referenced this issue May 2, 2024
…38066)

Related to #2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: 7d3bc93
MODULAR_ORIG_COMMIT_REV_ID: 9f0df24a5b93e625e84805896c0952401829a72d
patrickdoc added a commit that referenced this issue May 2, 2024
…#38060)

Related to #2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: c18c1c1
MODULAR_ORIG_COMMIT_REV_ID: 37775cfec39beac0c19d81db727d75b725c267f3
patrickdoc added a commit that referenced this issue May 2, 2024
…069)

Related to #2024

Signed-off-by: gabrieldemarmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: 16e1b61
MODULAR_ORIG_COMMIT_REV_ID: 4b0a198a56a816311fc2f203a7b4d59d4efc7a38
patrickdoc added a commit that referenced this issue May 2, 2024
) (#38175)

Related to #2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: 5d7f3c9

Co-authored-by: Gabriel de Marmiesse <gabriel.demarmiesse@datadoghq.com>
MODULAR_ORIG_COMMIT_REV_ID: fba146ceca1a00bb91bd421cd6e65d5b06eb5285
patrickdoc added a commit that referenced this issue May 2, 2024
…) (#38184)

Related to #2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: a7a1616

Co-authored-by: Gabriel de Marmiesse <gabriel.demarmiesse@datadoghq.com>
MODULAR_ORIG_COMMIT_REV_ID: 1686de46b918460709b34cffa4ce35ba67ab7e2b
patrickdoc added a commit that referenced this issue May 2, 2024
…) (#38173)

Related to #2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: 259ff10

---------

Co-authored-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>
Co-authored-by: abdul dakkak <adakkak@modular.com>
MODULAR_ORIG_COMMIT_REV_ID: e7d11af3de12f714c8b90ccebe4c64fe310c942c
patrickdoc added a commit that referenced this issue May 2, 2024
…8176)

Related to #2024

Signed-off-by: gabrieldemarmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: 76e4cec

Co-authored-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>
MODULAR_ORIG_COMMIT_REV_ID: 02e32e0b59a23dbf66ad6dc4cbab2d30cff0645d
patrickdoc added a commit that referenced this issue May 2, 2024
… (#38180)

Related to #2024

Signed-off-by: gabrieldemarmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: 6b780fa

---------

Co-authored-by: Gabriel de Marmiesse <gabriel.demarmiesse@datadoghq.com>
Co-authored-by: abdul dakkak <adakkak@modular.com>
MODULAR_ORIG_COMMIT_REV_ID: fe023a324baecb605ef3f8cacbc8b521486fb411
patrickdoc added a commit that referenced this issue May 2, 2024
…e.mojo` (#2292) (#38181)

Related to #2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: 0663b75

---------

Co-authored-by: Gabriel de Marmiesse <gabriel.demarmiesse@datadoghq.com>
Co-authored-by: abdul dakkak <adakkak@modular.com>
MODULAR_ORIG_COMMIT_REV_ID: 694dde80742a1c96a4db44777917c356f7d97d7f
patrickdoc added a commit that referenced this issue May 2, 2024
…(#38185)

Related to #2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: 1187746

---------

Co-authored-by: Gabriel de Marmiesse <gabriel.demarmiesse@datadoghq.com>
Co-authored-by: abdul dakkak <adakkak@modular.com>
MODULAR_ORIG_COMMIT_REV_ID: be39890d33887cc9a2563f3f46ec140df07e1f33
patrickdoc added a commit that referenced this issue May 2, 2024
…#38187)

Related to #2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: 8c68d64

---------

Co-authored-by: Gabriel de Marmiesse <gabriel.demarmiesse@datadoghq.com>
Co-authored-by: abdul dakkak <adakkak@modular.com>
MODULAR_ORIG_COMMIT_REV_ID: ec000ee778a6a2e0734f750ca412993c10437edb
patrickdoc added a commit that referenced this issue May 2, 2024
…#38188)

Related to #2024

Signed-off-by: Gabriel de Marmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: 457378c

Co-authored-by: Gabriel de Marmiesse <gabriel.demarmiesse@datadoghq.com>
MODULAR_ORIG_COMMIT_REV_ID: 58c17994244d682d61acdd20a98ccdbd3524ba21
patrickdoc added a commit that referenced this issue May 2, 2024
) (#38189)

Related to #2024

Signed-off-by: Ilham Firdausi Putra <ilhamfputra31@gmail.com>

mojo-orig-commit: e2dc80e

---------

Co-authored-by: Ilham F Putra <31740013+ilhamfp@users.noreply.github.com>
Co-authored-by: abdul dakkak <adakkak@modular.com>
MODULAR_ORIG_COMMIT_REV_ID: 1c599cfe2ffa531648fe15560afd2642a9654039
patrickdoc added a commit that referenced this issue May 2, 2024
…#38374)

Related to #2024

Signed-off-by: gabrieldemarmiesse <gabrieldemarmiesse@gmail.com>

mojo-orig-commit: 5690d78
MODULAR_ORIG_COMMIT_REV_ID: bf75fa4eab11628cfa2c48ed2211b31656362574
JoeLoser pushed a commit to JoeLoser/mojo that referenced this issue May 3, 2024
[External] [stdlib] Removed FileCheck from the dev guide

Related to modularml#2024

Co-authored-by: gabrieldemarmiesse <gabrieldemarmiesse@gmail.com>
Closes modularml#2451
MODULAR_ORIG_COMMIT_REV_ID: a32efb8642527372845fa6eeb43b997824f8f2be
JoeLoser pushed a commit that referenced this issue May 3, 2024
[External] [stdlib] Removed FileCheck from the dev guide

Related to #2024

Co-authored-by: gabrieldemarmiesse <gabrieldemarmiesse@gmail.com>
Closes #2451
MODULAR_ORIG_COMMIT_REV_ID: a32efb8642527372845fa6eeb43b997824f8f2be
modularbot pushed a commit that referenced this issue Jun 7, 2024
…jo` (#38630)

[External] [stdlib] Remove some `# CHECK` and refactor `test_print.mojo`

Related to #2024

Some tests in `test_print.mojo` are not related to printing at all. It's
more testing the string conversion. So I took the liberty of putting
them in the right files. This also helped remove some `# CHECK` as
removing those when testing the print() function is really hard.

Co-authored-by: gabrieldemarmiesse <gabrieldemarmiesse@gmail.com>
Closes #2356
MODULAR_ORIG_COMMIT_REV_ID: 61e4a967465eda080b89d85a2c5ad020a6a38d80
modularbot pushed a commit that referenced this issue Jun 7, 2024
…d `object.print()` (#38794)

[External] [stdlib] Remove FileCheck in `test_object.mojo` and removed
`object.print()`

Related to #2024

The rationale is in the changelog. Furthermore, it's easier to test
`str()` than `print()`

Co-authored-by: Gabriel de Marmiesse <gabriel.demarmiesse@datadoghq.com>
Closes #2334
MODULAR_ORIG_COMMIT_REV_ID: 9c31678d0add5e3df6488f82378afecc902a8767
modularbot pushed a commit that referenced this issue Jun 7, 2024
[External] [stdlib] Removed FileCheck from the dev guide

Related to #2024

Co-authored-by: gabrieldemarmiesse <gabrieldemarmiesse@gmail.com>
Closes #2451
MODULAR_ORIG_COMMIT_REV_ID: a32efb8642527372845fa6eeb43b997824f8f2be
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 mojo-repo Tag all issues with this label refactoring Refactoring/clean up of code
Projects
None yet
Development

No branches or pull requests

3 participants