diff --git a/notify/Cargo.toml b/notify/Cargo.toml index 97108b9c..0015918b 100644 --- a/notify/Cargo.toml +++ b/notify/Cargo.toml @@ -47,6 +47,8 @@ mio = { version = "0.8", features = ["os-ext"] } serde_json = "1.0.39" tempfile = "3.2.0" nix = "0.23.1" +insta = "1.34.0" +rstest = "0.17.0" [features] default = ["macos_fsevent","crossbeam-channel"] diff --git a/notify/src/event.rs b/notify/src/event.rs index 815fb62a..b870ec5f 100644 --- a/notify/src/event.rs +++ b/notify/src/event.rs @@ -195,6 +195,7 @@ pub enum RemoveKind { #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))] +#[cfg_attr(feature = "serde", serde(tag = "type"))] pub enum EventKind { /// The catch-all event kind, for unsupported/unknown events. /// @@ -304,7 +305,7 @@ pub struct Event { /// The `EventKind::Any` variant should be used as the "else" case when mapping native kernel /// bitmasks or bitmaps, such that if the mask is ever extended with new event types the /// backend will not gain bugs due to not matching new unknown event types. - #[cfg_attr(feature = "serde", serde(rename = "type"))] + #[cfg_attr(feature = "serde", serde(flatten))] pub kind: EventKind, /// Paths the event is about, if known. @@ -483,6 +484,7 @@ impl EventAttributes { /// particular ways. #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] #[cfg_attr(feature = "serde", derive(Deserialize, Serialize))] +#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] pub enum Flag { /// Rescan notices are emitted by some platforms (and may also be emitted by Notify itself). /// They indicate either a lapse in the events or a change in the filesystem such that events @@ -621,3 +623,74 @@ impl Hash for Event { self.source().hash(state); } } + +#[cfg(all(test, feature = "serde"))] +mod tests { + use super::*; + + use insta::assert_snapshot; + use rstest::rstest; + + #[rustfmt::skip] + #[rstest] + #[case("any", EventKind::Any)] + #[case("access-any", EventKind::Access(AccessKind::Any))] + #[case("access-read", EventKind::Access(AccessKind::Read))] + #[case("access-open-any", EventKind::Access(AccessKind::Open(AccessMode::Any)))] + #[case("access-open-execute", EventKind::Access(AccessKind::Open(AccessMode::Execute)))] + #[case("access-open-read", EventKind::Access(AccessKind::Open(AccessMode::Read)))] + #[case("access-open-write", EventKind::Access(AccessKind::Open(AccessMode::Write)))] + #[case("access-open-other", EventKind::Access(AccessKind::Open(AccessMode::Other)))] + #[case("access-close-any", EventKind::Access(AccessKind::Close(AccessMode::Any)))] + #[case("access-close-execute", EventKind::Access(AccessKind::Close(AccessMode::Execute)))] + #[case("access-close-read", EventKind::Access(AccessKind::Close(AccessMode::Read)))] + #[case("access-close-write", EventKind::Access(AccessKind::Close(AccessMode::Write)))] + #[case("access-close-other", EventKind::Access(AccessKind::Close(AccessMode::Other)))] + #[case("access-other", EventKind::Access(AccessKind::Other))] + #[case("create-any", EventKind::Create(CreateKind::Any))] + #[case("create-file", EventKind::Create(CreateKind::File))] + #[case("create-folder", EventKind::Create(CreateKind::Folder))] + #[case("create-other", EventKind::Create(CreateKind::Other))] + #[case("modify-any", EventKind::Modify(ModifyKind::Any))] + #[case("modify-data-any", EventKind::Modify(ModifyKind::Data(DataChange::Any)))] + #[case("modify-data-size", EventKind::Modify(ModifyKind::Data(DataChange::Size)))] + #[case("modify-data-content", EventKind::Modify(ModifyKind::Data(DataChange::Content)))] + #[case("modify-data-other", EventKind::Modify(ModifyKind::Data(DataChange::Other)))] + #[case("modify-metadata-any", EventKind::Modify(ModifyKind::Metadata(MetadataKind::Any)))] + #[case("modify-metadata-accesstime", EventKind::Modify(ModifyKind::Metadata(MetadataKind::AccessTime)))] + #[case("modify-metadata-writetime", EventKind::Modify(ModifyKind::Metadata(MetadataKind::WriteTime)))] + #[case("modify-metadata-permissions", EventKind::Modify(ModifyKind::Metadata(MetadataKind::Permissions)))] + #[case("modify-metadata-ownership", EventKind::Modify(ModifyKind::Metadata(MetadataKind::Ownership)))] + #[case("modify-metadata-extended", EventKind::Modify(ModifyKind::Metadata(MetadataKind::Extended)))] + #[case("modify-metadata-other", EventKind::Modify(ModifyKind::Metadata(MetadataKind::Other)))] + #[case("modify-name-any", EventKind::Modify(ModifyKind::Name(RenameMode::Any)))] + #[case("modify-name-to", EventKind::Modify(ModifyKind::Name(RenameMode::To)))] + #[case("modify-name-from", EventKind::Modify(ModifyKind::Name(RenameMode::From)))] + #[case("modify-name-both", EventKind::Modify(ModifyKind::Name(RenameMode::Both)))] + #[case("modify-name-other", EventKind::Modify(ModifyKind::Name(RenameMode::Other)))] + #[case("modify-other", EventKind::Modify(ModifyKind::Other))] + #[case("remove-any", EventKind::Remove(RemoveKind::Any))] + #[case("remove-file", EventKind::Remove(RemoveKind::File))] + #[case("remove-folder", EventKind::Remove(RemoveKind::Folder))] + #[case("remove-other", EventKind::Remove(RemoveKind::Other))] + #[case("other", EventKind::Other)] + fn serialize_event_kind( + #[case] name: &str, + #[case] event_kind: EventKind, + ) { + let event = Event::new(event_kind); + let json = serde_json::to_string(&event).unwrap(); + assert_snapshot!(name, json); + } + + #[test] + fn serialize_event_with_attrs() { + let event = Event::new(EventKind::Any) + .set_tracker(123) + .set_flag(Flag::Rescan) + .set_info("test event") + .set_process_id(0); + let json = serde_json::to_string(&event).unwrap(); + assert_snapshot!(json); + } +} diff --git a/notify/src/snapshots/notify__event__tests__access-any.snap b/notify/src/snapshots/notify__event__tests__access-any.snap new file mode 100644 index 00000000..ab0db488 --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__access-any.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"access","kind":"any","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__access-close-any.snap b/notify/src/snapshots/notify__event__tests__access-close-any.snap new file mode 100644 index 00000000..cfd8a846 --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__access-close-any.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"access","kind":"close","mode":"any","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__access-close-execute.snap b/notify/src/snapshots/notify__event__tests__access-close-execute.snap new file mode 100644 index 00000000..aabfe24d --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__access-close-execute.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"access","kind":"close","mode":"execute","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__access-close-other.snap b/notify/src/snapshots/notify__event__tests__access-close-other.snap new file mode 100644 index 00000000..85b32dc3 --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__access-close-other.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"access","kind":"close","mode":"other","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__access-close-read.snap b/notify/src/snapshots/notify__event__tests__access-close-read.snap new file mode 100644 index 00000000..7295f1bf --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__access-close-read.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"access","kind":"close","mode":"read","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__access-close-write.snap b/notify/src/snapshots/notify__event__tests__access-close-write.snap new file mode 100644 index 00000000..79c1322e --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__access-close-write.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"access","kind":"close","mode":"write","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__access-open-any.snap b/notify/src/snapshots/notify__event__tests__access-open-any.snap new file mode 100644 index 00000000..2fa7f722 --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__access-open-any.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"access","kind":"open","mode":"any","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__access-open-execute.snap b/notify/src/snapshots/notify__event__tests__access-open-execute.snap new file mode 100644 index 00000000..17203e29 --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__access-open-execute.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"access","kind":"open","mode":"execute","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__access-open-other.snap b/notify/src/snapshots/notify__event__tests__access-open-other.snap new file mode 100644 index 00000000..1d678d7c --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__access-open-other.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"access","kind":"open","mode":"other","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__access-open-read.snap b/notify/src/snapshots/notify__event__tests__access-open-read.snap new file mode 100644 index 00000000..e7340efc --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__access-open-read.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"access","kind":"open","mode":"read","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__access-open-write.snap b/notify/src/snapshots/notify__event__tests__access-open-write.snap new file mode 100644 index 00000000..e7dbac99 --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__access-open-write.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"access","kind":"open","mode":"write","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__access-other.snap b/notify/src/snapshots/notify__event__tests__access-other.snap new file mode 100644 index 00000000..fac2346e --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__access-other.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"access","kind":"other","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__access-read.snap b/notify/src/snapshots/notify__event__tests__access-read.snap new file mode 100644 index 00000000..16b9e65e --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__access-read.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"access","kind":"read","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__any.snap b/notify/src/snapshots/notify__event__tests__any.snap new file mode 100644 index 00000000..158bd11c --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__any.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"any","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__create-any.snap b/notify/src/snapshots/notify__event__tests__create-any.snap new file mode 100644 index 00000000..b59bdfba --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__create-any.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"create","kind":"any","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__create-file.snap b/notify/src/snapshots/notify__event__tests__create-file.snap new file mode 100644 index 00000000..87cc695a --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__create-file.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"create","kind":"file","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__create-folder.snap b/notify/src/snapshots/notify__event__tests__create-folder.snap new file mode 100644 index 00000000..fc411488 --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__create-folder.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"create","kind":"folder","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__create-other.snap b/notify/src/snapshots/notify__event__tests__create-other.snap new file mode 100644 index 00000000..7e3e4c99 --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__create-other.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"create","kind":"other","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__modify-any.snap b/notify/src/snapshots/notify__event__tests__modify-any.snap new file mode 100644 index 00000000..05a7e9b6 --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__modify-any.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"modify","kind":"any","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__modify-data-any.snap b/notify/src/snapshots/notify__event__tests__modify-data-any.snap new file mode 100644 index 00000000..aef1405a --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__modify-data-any.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"modify","kind":"data","mode":"any","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__modify-data-content.snap b/notify/src/snapshots/notify__event__tests__modify-data-content.snap new file mode 100644 index 00000000..10ba0902 --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__modify-data-content.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"modify","kind":"data","mode":"content","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__modify-data-other.snap b/notify/src/snapshots/notify__event__tests__modify-data-other.snap new file mode 100644 index 00000000..ed7b7942 --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__modify-data-other.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"modify","kind":"data","mode":"other","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__modify-data-size.snap b/notify/src/snapshots/notify__event__tests__modify-data-size.snap new file mode 100644 index 00000000..03a41241 --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__modify-data-size.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"modify","kind":"data","mode":"size","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__modify-metadata-accesstime.snap b/notify/src/snapshots/notify__event__tests__modify-metadata-accesstime.snap new file mode 100644 index 00000000..87245c80 --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__modify-metadata-accesstime.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"modify","kind":"metadata","mode":"access-time","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__modify-metadata-any.snap b/notify/src/snapshots/notify__event__tests__modify-metadata-any.snap new file mode 100644 index 00000000..0b2d24f2 --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__modify-metadata-any.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"modify","kind":"metadata","mode":"any","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__modify-metadata-extended.snap b/notify/src/snapshots/notify__event__tests__modify-metadata-extended.snap new file mode 100644 index 00000000..1519a62a --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__modify-metadata-extended.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"modify","kind":"metadata","mode":"extended","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__modify-metadata-other.snap b/notify/src/snapshots/notify__event__tests__modify-metadata-other.snap new file mode 100644 index 00000000..a524a468 --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__modify-metadata-other.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"modify","kind":"metadata","mode":"other","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__modify-metadata-ownership.snap b/notify/src/snapshots/notify__event__tests__modify-metadata-ownership.snap new file mode 100644 index 00000000..d89c2230 --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__modify-metadata-ownership.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"modify","kind":"metadata","mode":"ownership","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__modify-metadata-permissions.snap b/notify/src/snapshots/notify__event__tests__modify-metadata-permissions.snap new file mode 100644 index 00000000..df2e5d2d --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__modify-metadata-permissions.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"modify","kind":"metadata","mode":"permissions","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__modify-metadata-writetime.snap b/notify/src/snapshots/notify__event__tests__modify-metadata-writetime.snap new file mode 100644 index 00000000..f87395ba --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__modify-metadata-writetime.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"modify","kind":"metadata","mode":"write-time","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__modify-name-any.snap b/notify/src/snapshots/notify__event__tests__modify-name-any.snap new file mode 100644 index 00000000..f0000f3e --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__modify-name-any.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"modify","kind":"rename","mode":"any","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__modify-name-both.snap b/notify/src/snapshots/notify__event__tests__modify-name-both.snap new file mode 100644 index 00000000..9044379d --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__modify-name-both.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"modify","kind":"rename","mode":"both","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__modify-name-from.snap b/notify/src/snapshots/notify__event__tests__modify-name-from.snap new file mode 100644 index 00000000..5f809e5d --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__modify-name-from.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"modify","kind":"rename","mode":"from","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__modify-name-other.snap b/notify/src/snapshots/notify__event__tests__modify-name-other.snap new file mode 100644 index 00000000..afea033e --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__modify-name-other.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"modify","kind":"rename","mode":"other","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__modify-name-to.snap b/notify/src/snapshots/notify__event__tests__modify-name-to.snap new file mode 100644 index 00000000..d9dc10d4 --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__modify-name-to.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"modify","kind":"rename","mode":"to","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__modify-other.snap b/notify/src/snapshots/notify__event__tests__modify-other.snap new file mode 100644 index 00000000..f05f37f7 --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__modify-other.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"modify","kind":"other","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__other.snap b/notify/src/snapshots/notify__event__tests__other.snap new file mode 100644 index 00000000..dc825ae5 --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__other.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"other","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__remove-any.snap b/notify/src/snapshots/notify__event__tests__remove-any.snap new file mode 100644 index 00000000..e554a00d --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__remove-any.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"remove","kind":"any","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__remove-file.snap b/notify/src/snapshots/notify__event__tests__remove-file.snap new file mode 100644 index 00000000..cc9fed67 --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__remove-file.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"remove","kind":"file","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__remove-folder.snap b/notify/src/snapshots/notify__event__tests__remove-folder.snap new file mode 100644 index 00000000..a361f3cc --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__remove-folder.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"remove","kind":"folder","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__remove-other.snap b/notify/src/snapshots/notify__event__tests__remove-other.snap new file mode 100644 index 00000000..ed276ace --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__remove-other.snap @@ -0,0 +1,5 @@ +--- +source: notify/src/event.rs +expression: json +--- +{"type":"remove","kind":"other","paths":[],"attrs":{}} diff --git a/notify/src/snapshots/notify__event__tests__serialize_event_with_attrs.snap b/notify/src/snapshots/notify__event__tests__serialize_event_with_attrs.snap new file mode 100644 index 00000000..652da128 --- /dev/null +++ b/notify/src/snapshots/notify__event__tests__serialize_event_with_attrs.snap @@ -0,0 +1,6 @@ +--- +source: notify/src/event.rs +assertion_line: 694 +expression: json +--- +{"type":"any","paths":[],"attrs":{"tracker":123,"flag":"rescan","info":"test event"}}