tests(cmd): ensure insert statement works

This commit is contained in:
Khaïs COLIN 2025-05-03 21:13:46 +02:00
parent 1f90d0acc3
commit 75c3c74bba
3 changed files with 20 additions and 1 deletions

View file

@ -38,11 +38,12 @@ CLOCK: [2025-05-03 sam. 18:49]--[2025-05-03 sam. 18:57] => 0:08
:LOGBOOK:
CLOCK: [2025-05-03 sam. 19:00]--[2025-05-03 sam. 19:05] => 0:05
:END:
** TODO insta test insert
** DONE insta test insert
:PROPERTIES:
:EFFORT: 10min
:END:
:LOGBOOK:
CLOCK: [2025-05-03 sam. 21:10]--[2025-05-03 sam. 21:14] => 0:04
CLOCK: [2025-05-03 sam. 19:08]--[2025-05-03 sam. 19:21] => 0:13
:END:
*** DONE all display of command results must be made via a display method on CommandExecutionResult

View file

@ -101,3 +101,16 @@ impl std::str::FromStr for Command {
}
}
}
#[cfg(test)]
mod tests {
use crate::{command::Command, statements::Statement};
use insta::assert_snapshot;
#[test]
fn test_execute_insert_statement() {
let statement: Command = Statement::Insert.into();
let result = statement.execute().display();
assert_snapshot!(result);
}
}

View file

@ -0,0 +1,5 @@
---
source: src/command.rs
expression: result
---
insert