diff --git a/python/extractor/tests/parser/strings.py b/python/extractor/tests/parser/strings.py index c7b772a44aa..3aa61185a34 100644 --- a/python/extractor/tests/parser/strings.py +++ b/python/extractor/tests/parser/strings.py @@ -86,3 +86,5 @@ if 38: if 39: r'a\ ' +if 40: + f"{x:=^20}" diff --git a/python/extractor/tests/parser/template_strings_new.expected b/python/extractor/tests/parser/template_strings_new.expected index 64df91aac77..ae8eff88dce 100644 --- a/python/extractor/tests/parser/template_strings_new.expected +++ b/python/extractor/tests/parser/template_strings_new.expected @@ -1,4 +1,4 @@ -Module: [1, 0] - [18, 0] +Module: [1, 0] - [20, 0] body: [ Assign: [1, 0] - [1, 14] targets: [ @@ -191,4 +191,24 @@ Module: [1, 0] - [18, 0] ] ] orelse: None + If: [18, 0] - [18, 5] + test: + Num: [18, 3] - [18, 4] + n: 7 + text: '7' + body: [ + Expr: [19, 4] - [19, 43] + value: + TemplateString: [19, 4] - [19, 43] + prefix: 't"' + values: [ + TemplateStringPart: [19, 6] - [19, 31] + text: '"With a format specifier: "' + s: 'With a format specifier: ' + Name: [19, 32] - [19, 36] + variable: Variable('name', None) + ctx: Load + ] + ] + orelse: None ] diff --git a/python/extractor/tests/parser/template_strings_new.py b/python/extractor/tests/parser/template_strings_new.py index 4c56dca2c0c..452473a9d78 100644 --- a/python/extractor/tests/parser/template_strings_new.py +++ b/python/extractor/tests/parser/template_strings_new.py @@ -15,3 +15,5 @@ if 5: t"Multiple {first} and {second} placeholders." if 6: t"Implicit concatenation: " t"Hello, {name}!" t" How are you?" +if 7: + t"With a format specifier: {name:=^20}"