mirror of
https://github.com/nushell/nushell
synced 2024-12-27 05:23:11 +00:00
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:
parent
49f1dc080b
commit
11666bc715
2 changed files with 3 additions and 3 deletions
|
@ -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> > cd (path) <br><br>Flags:<br> -h, --help<br> Display the help message for this command<br><br>Parameters:<br> (optional) path <directory>: the path to change to<br><br>Examples:<br> Change to your home directory<br> > <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> > </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> > </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> > 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> <nothing> | cd <string?> -> <nothing><br> <string> | cd <string?> -> <nothing><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;'> <</span><span style='color:blue;font-weight:bold;'>directory<span style='color:black;font-weight:normal;'>>: 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> > </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> > </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> > </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> > cd (path) <br><br>Flags:<br> -h, --help - Display the help message for this command<br><br>Signatures:<br> <nothing> | cd <string?> -> <nothing><br> <string> | cd <string?> -> <nothing><br><br>Parameters:<br> (optional) path <directory>: the path to change to<br><br>Examples:<br> Change to your home directory<br> > cd ~<br><br> Change to a directory via abbreviations<br> > cd d/s/9<br><br> Change to the previous working directory ($OLDPWD)<br> > cd -<br><br></body></html>"
|
||||
r"<html><style>body { background-color:white;color:black; }</style><body>Change directory.<br><br>Usage:<br> > cd (path) <br><br>Flags:<br> -h, --help - Display the help message for this command<br><br>Signatures:<br> <nothing> | cd <string?> -> <nothing><br> <string> | cd <string?> -> <nothing><br><br>Parameters:<br> (optional) path <directory>: the path to change to<br><br>Examples:<br> Change to your home directory<br> > cd ~<br> ...<br><br> Change to a directory via abbreviations<br> > cd d/s/9<br> ...<br><br> Change to the previous working directory ($OLDPWD)<br> > cd -<br> ...<br><br></body></html>"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue