mirror of
https://github.com/nushell/nushell.git
synced 2024-12-11 09:43:24 +01:00
2fd464bf7b
* refactor and cleanup to md * Add padding around values in each row * Add padding to test * Update code to satisfy Clippy and pass other failing tests
38 lines
672 B
Rust
38 lines
672 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 |");
|
|
}
|