From 6cc0bda5f676c4ae3ffb0118db5f0b6c084dfd8f Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Thu, 28 Mar 2024 23:08:56 -0500 Subject: [PATCH] fix: add newline to incorrect-modifier output --- slither/detectors/functions/modifier.py | 2 +- ...ModifierDefaultDetection_0_4_25_modifier_default_sol__0.txt | 3 +++ ...ModifierDefaultDetection_0_5_16_modifier_default_sol__0.txt | 3 +++ ...ModifierDefaultDetection_0_6_11_modifier_default_sol__0.txt | 3 +++ ..._ModifierDefaultDetection_0_7_6_modifier_default_sol__0.txt | 3 +++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/slither/detectors/functions/modifier.py b/slither/detectors/functions/modifier.py index 61ec1825e2..7f14872663 100644 --- a/slither/detectors/functions/modifier.py +++ b/slither/detectors/functions/modifier.py @@ -89,7 +89,7 @@ def _detect(self) -> List[Output]: info: DETECTOR_INFO = [ "Modifier ", mod, - " does not always execute _; or revert", + " does not always execute _; or revert\n", ] res = self.generate_result(info) diff --git a/tests/e2e/detectors/snapshots/detectors__detector_ModifierDefaultDetection_0_4_25_modifier_default_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_ModifierDefaultDetection_0_4_25_modifier_default_sol__0.txt index 365f1f3970..4bee7f781a 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_ModifierDefaultDetection_0_4_25_modifier_default_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_ModifierDefaultDetection_0_4_25_modifier_default_sol__0.txt @@ -1,3 +1,6 @@ Modifier Test.loopsNoResult() (tests/e2e/detectors/test_data/incorrect-modifier/0.4.25/modifier_default.sol#30-41) does not always execute _; or revert + Modifier Test.requireAssertNoResult() (tests/e2e/detectors/test_data/incorrect-modifier/0.4.25/modifier_default.sol#18-22) does not always execute _; or revert + Modifier Test.noResult() (tests/e2e/detectors/test_data/incorrect-modifier/0.4.25/modifier_default.sol#2-6) does not always execute _; or revert + diff --git a/tests/e2e/detectors/snapshots/detectors__detector_ModifierDefaultDetection_0_5_16_modifier_default_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_ModifierDefaultDetection_0_5_16_modifier_default_sol__0.txt index 5f5a1b5f80..81015cb40c 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_ModifierDefaultDetection_0_5_16_modifier_default_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_ModifierDefaultDetection_0_5_16_modifier_default_sol__0.txt @@ -1,3 +1,6 @@ Modifier Test.loopsNoResult() (tests/e2e/detectors/test_data/incorrect-modifier/0.5.16/modifier_default.sol#30-41) does not always execute _; or revert + Modifier Test.requireAssertNoResult() (tests/e2e/detectors/test_data/incorrect-modifier/0.5.16/modifier_default.sol#18-22) does not always execute _; or revert + Modifier Test.noResult() (tests/e2e/detectors/test_data/incorrect-modifier/0.5.16/modifier_default.sol#2-6) does not always execute _; or revert + diff --git a/tests/e2e/detectors/snapshots/detectors__detector_ModifierDefaultDetection_0_6_11_modifier_default_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_ModifierDefaultDetection_0_6_11_modifier_default_sol__0.txt index b4d5bf3e46..a03054897c 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_ModifierDefaultDetection_0_6_11_modifier_default_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_ModifierDefaultDetection_0_6_11_modifier_default_sol__0.txt @@ -1,3 +1,6 @@ Modifier Test.loopsNoResult() (tests/e2e/detectors/test_data/incorrect-modifier/0.6.11/modifier_default.sol#30-41) does not always execute _; or revert + Modifier Test.requireAssertNoResult() (tests/e2e/detectors/test_data/incorrect-modifier/0.6.11/modifier_default.sol#18-22) does not always execute _; or revert + Modifier Test.noResult() (tests/e2e/detectors/test_data/incorrect-modifier/0.6.11/modifier_default.sol#2-6) does not always execute _; or revert + diff --git a/tests/e2e/detectors/snapshots/detectors__detector_ModifierDefaultDetection_0_7_6_modifier_default_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_ModifierDefaultDetection_0_7_6_modifier_default_sol__0.txt index bba830c3bd..09e74952e1 100644 --- a/tests/e2e/detectors/snapshots/detectors__detector_ModifierDefaultDetection_0_7_6_modifier_default_sol__0.txt +++ b/tests/e2e/detectors/snapshots/detectors__detector_ModifierDefaultDetection_0_7_6_modifier_default_sol__0.txt @@ -1,3 +1,6 @@ Modifier Test.loopsNoResult() (tests/e2e/detectors/test_data/incorrect-modifier/0.7.6/modifier_default.sol#30-41) does not always execute _; or revert + Modifier Test.requireAssertNoResult() (tests/e2e/detectors/test_data/incorrect-modifier/0.7.6/modifier_default.sol#18-22) does not always execute _; or revert + Modifier Test.noResult() (tests/e2e/detectors/test_data/incorrect-modifier/0.7.6/modifier_default.sol#2-6) does not always execute _; or revert +