fill example's description, add second example

This commit is contained in:
Bahex 2024-12-21 22:04:24 +03:00
parent 9342c91c55
commit e259d37027

View File

@ -28,16 +28,27 @@ impl Command for BytesSplit {
} }
fn examples(&self) -> Vec<Example> { fn examples(&self) -> Vec<Example> {
vec![Example { vec![
example: r#"0x[66 6F 6F 20 62 61 72 20 62 61 7A 20] | bytes split 0x[20]"#, Example {
description: "", example: r#"0x[66 6F 6F 20 62 61 72 20 62 61 7A 20] | bytes split 0x[20]"#,
result: Some(Value::test_list(vec![ description: "Split a binary value using a binary separator",
Value::test_binary("foo"), result: Some(Value::test_list(vec![
Value::test_binary("bar"), Value::test_binary("foo"),
Value::test_binary("baz"), Value::test_binary("bar"),
Value::test_binary(""), Value::test_binary("baz"),
])), Value::test_binary(""),
}] ])),
},
Example {
example: r#"0x[61 2D 2D 62 2D 2D 63] | bytes split "--""#,
description: "Split a binary value using a string separator",
result: Some(Value::test_list(vec![
Value::test_binary("a"),
Value::test_binary("b"),
Value::test_binary("c"),
])),
},
]
} }
fn run( fn run(