mirror of
https://github.com/nushell/nushell.git
synced 2025-03-28 08:36:09 +01:00
# Description As suggested by @WindSoilder, since plugins can now contain both simple commands that produce `Value` and commands that produce `PipelineData` without having to choose one or the other for the whole plugin, this change merges `stream_example` into `example`. # User-Facing Changes All of the example plugins are renamed. # Tests + Formatting - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib` # After Submitting - [ ] Check nushell/nushell.github.io for any docs that match the command names changed
30 lines
818 B
Rust
30 lines
818 B
Rust
use nu_test_support::nu_with_plugins;
|
|
use nu_test_support::playground::Playground;
|
|
|
|
#[test]
|
|
fn help() {
|
|
Playground::setup("help", |dirs, _| {
|
|
let actual = nu_with_plugins!(
|
|
cwd: dirs.test(),
|
|
plugin: ("nu_plugin_example"),
|
|
"example one --help"
|
|
);
|
|
|
|
assert!(actual.out.contains("PluginSignature test 1"));
|
|
assert!(actual.out.contains("Extra usage for example one"));
|
|
})
|
|
}
|
|
|
|
#[test]
|
|
fn search_terms() {
|
|
Playground::setup("search_terms", |dirs, _| {
|
|
let actual = nu_with_plugins!(
|
|
cwd: dirs.test(),
|
|
plugin: ("nu_plugin_example"),
|
|
r#"help commands | where name == "example one" | echo $"search terms: ($in.search_terms)""#
|
|
);
|
|
|
|
assert!(actual.out.contains("search terms: [example]"));
|
|
})
|
|
}
|