From b1a4cb6a77f6b74f1b942e043a57d043cde8c2e8 Mon Sep 17 00:00:00 2001 From: sydhds Date: Tue, 14 May 2024 10:46:45 +0200 Subject: [PATCH] Allow patch constant to patch type like Option and to replace computed values --- massa_test_framework/compile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/massa_test_framework/compile.py b/massa_test_framework/compile.py index fbb4cf3..a9f99d2 100644 --- a/massa_test_framework/compile.py +++ b/massa_test_framework/compile.py @@ -26,7 +26,7 @@ def apply(self, root=Path, strip: int = 0, fuzz: bool = False): with open(root / self.constant_file, "r+") as fp: content = fp.read() content_sub = re.sub( - f"(pub )?const {self.constant_name}: (\w+) = (\w+);", + f"(pub )?const {self.constant_name}: ([\w\<\>]+) = ([\w\s\*\(\)]+);", f"\g<1>const {self.constant_name}: \g<2> = {self.new_value};", content, )