Fix to md errors (#2729)

* Fix to md errors

* Fix variable name and avoid typecasts
This commit is contained in:
Joseph T. Lyons
2020-11-06 12:40:53 -05:00
committed by GitHub
parent 80b39454ff
commit 0ee054b14d
2 changed files with 57 additions and 7 deletions

View File

@ -1,7 +1,31 @@
use nu_test_support::{nu, pipeline};
#[test]
fn out_md_simple() {
fn md_empty() {
let actual = nu!(
cwd: ".", pipeline(
r#"
echo "{}" | from json | to md
"#
));
assert_eq!(actual.out, "");
}
#[test]
fn md_empty_pretty() {
let actual = nu!(
cwd: ".", pipeline(
r#"
echo "{}" | from json | to md -p
"#
));
assert_eq!(actual.out, "");
}
#[test]
fn md_simple() {
let actual = nu!(
cwd: ".", pipeline(
r#"
@ -13,7 +37,19 @@ fn out_md_simple() {
}
#[test]
fn out_md_table() {
fn md_simple_pretty() {
let actual = nu!(
cwd: ".", pipeline(
r#"
echo 3 | to md -p
"#
));
assert_eq!(actual.out, "3");
}
#[test]
fn md_table() {
let actual = nu!(
cwd: ".", pipeline(
r#"
@ -25,7 +61,7 @@ fn out_md_table() {
}
#[test]
fn out_md_table_pretty() {
fn md_table_pretty() {
let actual = nu!(
cwd: ".", pipeline(
r#"