From 1fbca325b32e3cf9603317d28bf3349502ac9ee6 Mon Sep 17 00:00:00 2001 From: Benjamin Bannier Date: Tue, 1 Oct 2024 15:26:39 +0200 Subject: [PATCH] Add baseline for removal of inline hooks which are not field hooks --- rule-tests/__snapshots__/empty-hook-snapshot.yml | 15 +++++++++++++++ rule-tests/empty-hook-test.yml | 2 ++ 2 files changed, 17 insertions(+) diff --git a/rule-tests/__snapshots__/empty-hook-snapshot.yml b/rule-tests/__snapshots__/empty-hook-snapshot.yml index ea8d921..e3f08d2 100644 --- a/rule-tests/__snapshots__/empty-hook-snapshot.yml +++ b/rule-tests/__snapshots__/empty-hook-snapshot.yml @@ -15,3 +15,18 @@ snapshots: style: secondary start: 8 end: 10 + type X = unit { on %done {} };: + fixed: type X = unit { }; + labels: + - source: on %done {} + style: primary + start: 16 + end: 27 + - source: '{}' + style: secondary + start: 25 + end: 27 + - source: '{}' + style: secondary + start: 25 + end: 27 diff --git a/rule-tests/empty-hook-test.yml b/rule-tests/empty-hook-test.yml index 20a658c..e7b31b0 100644 --- a/rule-tests/empty-hook-test.yml +++ b/rule-tests/empty-hook-test.yml @@ -2,5 +2,7 @@ id: empty-hook valid: - "on X::x {1;}" - "on X::x {1;2;}" + - "type X = unit { on %done {1;} };" invalid: - "on X::x {}" + - "type X = unit { on %done {} };"