mirror of
https://github.com/nushell/nushell.git
synced 2024-12-03 22:06:54 +01:00
bf2363947b
* First draft for adding a `pretty` flag to `to md` * rustfmt * Fix Clippy warnings * rustfmt * Using Clippy suggestion broken code, reverting and putting in a statement to ignore clippy warning * Add test for `to md -p`
38 lines
666 B
Rust
38 lines
666 B
Rust
use nu_test_support::{nu, pipeline};
|
|
|
|
#[test]
|
|
fn out_md_simple() {
|
|
let actual = nu!(
|
|
cwd: ".", pipeline(
|
|
r#"
|
|
echo 3 | to md
|
|
"#
|
|
));
|
|
|
|
assert_eq!(actual.out, "3");
|
|
}
|
|
|
|
#[test]
|
|
fn out_md_table() {
|
|
let actual = nu!(
|
|
cwd: ".", pipeline(
|
|
r#"
|
|
echo '{"name": "jason"}' | from json | to md
|
|
"#
|
|
));
|
|
|
|
assert_eq!(actual.out, "|name||-||jason|");
|
|
}
|
|
|
|
#[test]
|
|
fn out_md_table_pretty() {
|
|
let actual = nu!(
|
|
cwd: ".", pipeline(
|
|
r#"
|
|
echo '{"name": "joseph"}' | from json | to md -p
|
|
"#
|
|
));
|
|
|
|
assert_eq!(actual.out, "|name ||------||joseph|");
|
|
}
|