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

add tests to str.nu #627

Merged
merged 2 commits into from
Oct 2, 2023
Merged

add tests to str.nu #627

merged 2 commits into from
Oct 2, 2023

Conversation

savente93
Copy link
Contributor

As requested by @amtoine 😋

Copy link
Member

@amtoine amtoine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when i try to run the tests, i get the following errors

> use std testing run-tests; run-tests --path stdlib-candidate/ --module str
2023-10-02T18:57:56.996|INF|Running test_prepend in module str
2023-10-02T18:57:56.997|INF|Running test_append in module str
Error: nu::shell::external_command

  × External command failed
    ╭─[/home/amtoine/documents/repos/github.com/amtoine/nu_scripts/stdlib-candidate/ZUS8deD3N3.nu:29:1]
 29      use std assert error
 30      assert equal ("foo" | str prepend "/") "/foo"
    ·     ───┬──
    ·        ╰── command 'assert' was not found but it exists in module 'assert'; try importing it with `use`
 31      assert equal (["foo", "bar", "baz"] | str prepend "/") ["/foo", "/bar", "/baz"]
    ╰────
  help: No such file or directory (os error 2)

Error: nu::shell::external_command

  × External command failed
    ╭─[/home/amtoine/documents/repos/github.com/amtoine/nu_scripts/stdlib-candidate/y72rkBPeXL.nu:21:1]
 21      use std assert error
 22      assert equal ("foo" | str append "/") "foo/"
    ·     ───┬──
    ·        ╰── command 'assert' was not found but it exists in module 'assert'; try importing it with `use`
 23      assert equal (["foo", "bar", "baz"] | str append "/") ["foo/", "bar/", "baz/"]
    ╰────
  help: No such file or directory (os error 2)

Error:   × some tests did not pass (see complete errors below):
  
        str test_append
        str test_prepend
  

i think the two suggestions below should solve this 😋

stdlib-candidate/str.nu Outdated Show resolved Hide resolved
stdlib-candidate/str.nu Outdated Show resolved Hide resolved
my bad

Co-authored-by: Antoine Stevan <[email protected]>
@savente93
Copy link
Contributor Author

Whoopsie, sorry bout that 😅

Copy link
Member

@amtoine amtoine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoopsie, sorry bout that 😅

no worries, it works like a charm now 😉
thanks for the quick fix and adding the tests 🙏

@amtoine amtoine merged commit dae6115 into nushell:main Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants