diff --git a/notes.org b/notes.org index 10ec924..39d3be7 100644 --- a/notes.org +++ b/notes.org @@ -13,7 +13,7 @@ CLOCK: [2025-05-03 sam. 18:40]--[2025-05-03 sam. 18:46] => 0:06 :END: ** TODO OSDBError::display() should take a filename and display it alongside the error -* TODO snapshot testing +* DONE snapshot testing ** DONE Find the snapshot testing library :PROPERTIES: @@ -74,10 +74,13 @@ CLOCK: [2025-05-03 sam. 21:16]--[2025-05-03 sam. 21:18] => 0:02 :LOGBOOK: CLOCK: [2025-05-03 sam. 21:18]--[2025-05-03 sam. 21:21] => 0:03 :END: -** TODO insta test wrong meta-command +** DONE insta test wrong meta-command :PROPERTIES: :EFFORT: 10min :END: +:LOGBOOK: +CLOCK: [2025-05-03 sam. 21:21]--[2025-05-03 sam. 21:22] => 0:01 +:END: * DONE exit message is not displayed when pressing C-d :bug: :PROPERTIES: diff --git a/src/command.rs b/src/command.rs index 40ca37e..32e4cd0 100644 --- a/src/command.rs +++ b/src/command.rs @@ -133,4 +133,9 @@ mod tests { fn test_parse_wrong_statement() { assert_debug_snapshot!("salact".parse::()); } + + #[test] + fn test_parse_wrong_meta_command() { + assert_debug_snapshot!(".halp".parse::()); + } } diff --git a/src/snapshots/osdb__command__tests__parse_wrong_meta_command.snap b/src/snapshots/osdb__command__tests__parse_wrong_meta_command.snap new file mode 100644 index 0000000..556ca53 --- /dev/null +++ b/src/snapshots/osdb__command__tests__parse_wrong_meta_command.snap @@ -0,0 +1,11 @@ +--- +source: src/command.rs +expression: "\".halp\".parse::()" +--- +Err( + MetaCommand( + Unrecognized { + cmd: ".halp", + }, + ), +)