fix the tests involving a --help

The outputs of `each --help` and `cd --help` have obviously changed
in this PR.

i've simply run
```bash
>  cargo run
```
to drop into the new `nushell` and clipped the output of the new
- `each --help | lines | length` from
  `src/tests/test_engine.rs::help_works_with_missing_requirements`
- `cd --help | to html --html-color` from
  `crates/nu-command/tests/format_conversions/html.rs::test_cd_html_color_flag_dark_false`
- `cd --help | to html --no-color` from
  `crates/nu-command/tests/format_conversions/html.rs::test_no_color_flag`
This commit is contained in:
amtoine 2023-02-24 11:18:40 +01:00
parent 49f1dc080b
commit 11666bc715
No known key found for this signature in database
GPG Key ID: 37AAE9B486CFF1AB
2 changed files with 3 additions and 3 deletions

View File

@ -57,7 +57,7 @@ fn test_cd_html_color_flag_dark_false() {
);
assert_eq!(
actual.out,
r"<html><style>body { background-color:white;color:black; }</style><body>Change directory.<br><br>Usage:<br> &gt; cd (path) <br><br>Flags:<br> -h, --help<br> Display the help message for this command<br><br>Parameters:<br> (optional) path &lt;directory&gt;: the path to change to<br><br>Examples:<br> Change to your home directory<br> &gt; <span style='color:#037979;font-weight:bold;'>cd<span style='color:black;font-weight:normal;'> </span></span><span style='color:#037979;'>~<span style='color:black;font-weight:normal;'><br><br> Change to a directory via abbreviations<br> &gt; </span><span style='color:#037979;font-weight:bold;'>cd<span style='color:black;font-weight:normal;'> </span></span></span><span style='color:#037979;'>d/s/9<span style='color:black;font-weight:normal;'><br><br> Change to the previous working directory ($OLDPWD)<br> &gt; </span><span style='color:#037979;font-weight:bold;'>cd<span style='color:black;font-weight:normal;'> </span></span></span><span style='color:#037979;'>-<span style='color:black;font-weight:normal;'><br><br></body></html></span></span>"
r"<html><style>body { background-color:white;color:black; }</style><body>Change directory.<br><br><span style='color:green;'>Usage<span style='color:black;font-weight:normal;'>:<br> &gt; cd (path) <br><br></span></span><span style='color:green;'>Flags<span style='color:black;font-weight:normal;'>:<br> </span></span><span style='color:#037979;'>-h</span>,<span style='color:black;font-weight:normal;'> </span><span style='color:#037979;'>--help<span style='color:black;font-weight:normal;'> - Display the help message for this command<br><br></span><span style='color:green;'>Signatures<span style='color:black;font-weight:normal;'>:<br> &lt;nothing&gt; | cd &lt;string?&gt; -&gt; &lt;nothing&gt;<br> &lt;string&gt; | cd &lt;string?&gt; -&gt; &lt;nothing&gt;<br><br></span></span><span style='color:green;'>Parameters<span style='color:black;font-weight:normal;'>:<br> (optional) </span></span></span><span style='color:#037979;'>path<span style='color:black;font-weight:normal;'> &lt;</span><span style='color:blue;font-weight:bold;'>directory<span style='color:black;font-weight:normal;'>&gt;: the path to change to<br><br></span></span><span style='color:green;'>Examples<span style='color:black;font-weight:normal;'>:<br> Change to your home directory<br> &gt; </span><span style='color:#037979;font-weight:bold;'>cd<span style='color:black;font-weight:normal;'> </span></span></span></span><span style='color:#037979;'>~<span style='color:black;font-weight:normal;'><br> </span></span>...<span style='color:black;font-weight:normal;'><br><br> Change to a directory via abbreviations<br> &gt; </span><span style='color:#037979;font-weight:bold;'>cd<span style='color:black;font-weight:normal;'> </span></span><span style='color:#037979;'>d/s/9<span style='color:black;font-weight:normal;'><br> </span></span>...<span style='color:black;font-weight:normal;'><br><br> Change to the previous working directory ($OLDPWD)<br> &gt; </span><span style='color:#037979;font-weight:bold;'>cd<span style='color:black;font-weight:normal;'> </span></span><span style='color:#037979;'>-<span style='color:black;font-weight:normal;'><br> </span></span>...<span style='color:black;font-weight:normal;'><br><br></body></html></span>"
);
}
@ -72,7 +72,7 @@ fn test_no_color_flag() {
);
assert_eq!(
actual.out,
r"<html><style>body { background-color:white;color:black; }</style><body>Change directory.<br><br>Usage:<br> &gt; cd (path) <br><br>Flags:<br> -h, --help - Display the help message for this command<br><br>Signatures:<br> &lt;nothing&gt; | cd &lt;string?&gt; -&gt; &lt;nothing&gt;<br> &lt;string&gt; | cd &lt;string?&gt; -&gt; &lt;nothing&gt;<br><br>Parameters:<br> (optional) path &lt;directory&gt;: the path to change to<br><br>Examples:<br> Change to your home directory<br> &gt; cd ~<br><br> Change to a directory via abbreviations<br> &gt; cd d/s/9<br><br> Change to the previous working directory ($OLDPWD)<br> &gt; cd -<br><br></body></html>"
r"<html><style>body { background-color:white;color:black; }</style><body>Change directory.<br><br>Usage:<br> &gt; cd (path) <br><br>Flags:<br> -h, --help - Display the help message for this command<br><br>Signatures:<br> &lt;nothing&gt; | cd &lt;string?&gt; -&gt; &lt;nothing&gt;<br> &lt;string&gt; | cd &lt;string?&gt; -&gt; &lt;nothing&gt;<br><br>Parameters:<br> (optional) path &lt;directory&gt;: the path to change to<br><br>Examples:<br> Change to your home directory<br> &gt; cd ~<br> ...<br><br> Change to a directory via abbreviations<br> &gt; cd d/s/9<br> ...<br><br> Change to the previous working directory ($OLDPWD)<br> &gt; cd -<br> ...<br><br></body></html>"
);
}

View File

@ -53,7 +53,7 @@ fn in_and_if_else() -> TestResult {
#[test]
fn help_works_with_missing_requirements() -> TestResult {
run_test(r#"each --help | lines | length"#, "43")
run_test(r#"each --help | lines | length"#, "70")
}
#[test]