feat: Add support for tabular/csv data input.

This commit is contained in:
2026-03-14 14:54:13 -04:00
parent eab872d2ed
commit 8077469d19
24 changed files with 1137 additions and 133 deletions

View File

@@ -188,9 +188,8 @@ mod tests {
#[test]
fn response_add_items() {
let json = r#"{"action": "add_items", "items": [{"label": "new"}]}"#;
let resp: HookResponse = serde_json::from_str(json).unwrap_or_else(|e| {
std::unreachable!("parse failed: {e}")
});
let resp: HookResponse =
serde_json::from_str(json).unwrap_or_else(|e| std::unreachable!("parse failed: {e}"));
assert_eq!(
resp,
HookResponse::AddItems {
@@ -202,9 +201,8 @@ mod tests {
#[test]
fn response_replace_items() {
let json = r#"{"action": "replace_items", "items": ["a", "b"]}"#;
let resp: HookResponse = serde_json::from_str(json).unwrap_or_else(|e| {
std::unreachable!("parse failed: {e}")
});
let resp: HookResponse =
serde_json::from_str(json).unwrap_or_else(|e| std::unreachable!("parse failed: {e}"));
assert_eq!(
resp,
HookResponse::ReplaceItems {
@@ -216,9 +214,8 @@ mod tests {
#[test]
fn response_remove_items() {
let json = r#"{"action": "remove_items", "indices": [0, 3, 5]}"#;
let resp: HookResponse = serde_json::from_str(json).unwrap_or_else(|e| {
std::unreachable!("parse failed: {e}")
});
let resp: HookResponse =
serde_json::from_str(json).unwrap_or_else(|e| std::unreachable!("parse failed: {e}"));
assert_eq!(
resp,
HookResponse::RemoveItems {
@@ -230,9 +227,8 @@ mod tests {
#[test]
fn response_set_filter() {
let json = r#"{"action": "set_filter", "text": "hello"}"#;
let resp: HookResponse = serde_json::from_str(json).unwrap_or_else(|e| {
std::unreachable!("parse failed: {e}")
});
let resp: HookResponse =
serde_json::from_str(json).unwrap_or_else(|e| std::unreachable!("parse failed: {e}"));
assert_eq!(
resp,
HookResponse::SetFilter {
@@ -244,9 +240,8 @@ mod tests {
#[test]
fn response_close() {
let json = r#"{"action": "close"}"#;
let resp: HookResponse = serde_json::from_str(json).unwrap_or_else(|e| {
std::unreachable!("parse failed: {e}")
});
let resp: HookResponse =
serde_json::from_str(json).unwrap_or_else(|e| std::unreachable!("parse failed: {e}"));
assert_eq!(resp, HookResponse::Close);
}