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

Fix invalid variable name in input command docs #6716

Merged
merged 1 commit into from Oct 13, 2022
Merged

Fix invalid variable name in input command docs #6716

merged 1 commit into from Oct 13, 2022

Conversation

holly-hacker
Copy link
Contributor

Description

This PR fixes invalid syntax in the example of the input command. Previously, it contained a variable name user-input, which is not valid in nu 0.69.1. Related to nushell/nushell.github.io#635.

Tests

Make sure you've done the following:

  • Add tests that cover your changes, either in the command examples, the crate/tests folder, or in the /tests folder.
  • Try to think about corner cases and various ways how your changes could break. Cover them with tests.
  • If adding tests is not possible, please document in the PR body a minimal example with steps on how to reproduce so one can verify your change works.

Make sure you've run and fixed any issues with these commands:

  • cargo fmt --all -- --check to check standard code formatting (cargo fmt --all applies these changes)
  • cargo clippy --workspace --features=extra -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect to check that you're using the standard code style
  • cargo test --workspace --features=extra to check that all the tests pass

I didn't change any code but ran the test suite anyway and got the following test failure. Seems like this test is not locale aware? :)

failures:

---- conversions::into::string::test::test_examples stdout ----
input: 5 | into string -d 3
result: String { val: "5,000", span: Span { start: 4, end: 15 } }
done: 757.9µs
thread 'conversions::into::string::test::test_examples' panicked at 'the example result is different to expected value: String { val: "5,000", span: Span { start: 4, end: 15 } } != String { val: "5.000", span: Span { start: 0, end: 0 } }', crates\nu-command\src\example_test.rs:140:25
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    conversions::into::string::test::test_examples

fdncred pushed a commit to nushell/nushell.github.io that referenced this pull request Oct 13, 2022
* Fix example variables using `-` in their name

* Undo change to auto-generated documentation.

This will be fixed by nushell/nushell#6716
@fdncred
Copy link
Collaborator

fdncred commented Oct 13, 2022

thanks

@fdncred fdncred merged commit 9446e39 into nushell:main Oct 13, 2022
@holly-hacker holly-hacker deleted the fix-invalid-variable-name-in-doc branch October 13, 2022 17:47
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