Add example tests (nu-plugin-test-support) for plugins in repo (#12281)

# Description

Uses the new `nu-plugin-test-support` crate to test the examples of
commands provided by plugins in the repo.

Also fixed some of the examples to pass.

# User-Facing Changes

- Examples that are more guaranteed to work

# Tests + Formatting
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`
This commit is contained in:
Devyn Cairns
2024-03-25 19:20:35 -07:00
committed by GitHub
parent efe1c99a3b
commit 2ae4408ced
19 changed files with 139 additions and 6 deletions

View File

@ -54,3 +54,11 @@ impl SimplePluginCommand for Generate2 {
}
}
}
#[test]
fn test_examples() -> Result<(), nu_protocol::ShellError> {
use nu_plugin_test_support::PluginTest;
PluginTest::new("custom_values", crate::CustomValuePlugin.into())?
.test_command_examples(&Generate2)
}