mirror of
https://github.com/nushell/nushell.git
synced 2025-01-03 04:50:28 +01:00
add example, search terms and test
This commit is contained in:
parent
e5c82edb33
commit
9342c91c55
@ -23,6 +23,23 @@ impl Command for BytesSplit {
|
||||
"Split input into multiple items using a separator."
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["separate", "stream"]
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
vec![Example {
|
||||
example: r#"0x[66 6F 6F 20 62 61 72 20 62 61 7A 20] | bytes split 0x[20]"#,
|
||||
description: "",
|
||||
result: Some(Value::test_list(vec![
|
||||
Value::test_binary("foo"),
|
||||
Value::test_binary("bar"),
|
||||
Value::test_binary("baz"),
|
||||
Value::test_binary(""),
|
||||
])),
|
||||
}]
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
@ -67,3 +84,15 @@ impl Command for BytesSplit {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_examples() {
|
||||
use crate::test_examples;
|
||||
|
||||
test_examples(BytesSplit {})
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user