mirror of
https://github.com/nushell/nushell.git
synced 2025-08-15 02:32:51 +02:00
Add simple to-html output and bump version (#1487)
This commit is contained in:
28
crates/nu-cli/tests/format_conversions/html.rs
Normal file
28
crates/nu-cli/tests/format_conversions/html.rs
Normal file
@ -0,0 +1,28 @@
|
||||
use nu_test_support::{nu, pipeline};
|
||||
|
||||
#[test]
|
||||
fn out_html_simple() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
echo 3 | to-html
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual, "<html><body>3</body></html>");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn out_html_table() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
echo '{"name": "jason"}' | from-json | to-html
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(
|
||||
actual,
|
||||
"<html><body><table><tr><th>name</th></tr><tr><td>jason</td></tr></table></body></html>"
|
||||
);
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
mod bson;
|
||||
mod csv;
|
||||
mod html;
|
||||
mod json;
|
||||
mod ods;
|
||||
mod sqlite;
|
||||
|
Reference in New Issue
Block a user