mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
109 lines
6.9 KiB
Python
Executable File
109 lines
6.9 KiB
Python
Executable File
from __future__ import unicode_literals
|
|
|
|
mixed_format1 = "{}{1}"
|
|
named_format1 = "{name!r}, {0}"
|
|
explicit_format1 = "{0}, {1}"
|
|
implicit_format1 = "{}, {}"
|
|
|
|
mixed_format2 = "{}{1}"
|
|
named_format2 = "{name!r}, {0}"
|
|
explicit_format2 = "{0}, {1}"
|
|
implicit_format2 = "{}, {}"
|
|
|
|
|
|
mixed_format1.format("Hello", "World")
|
|
format(mixed_format2, "Hello", "World")
|
|
|
|
named_format1.format("Hello", world="World")
|
|
format(named_format2, "Hello", world="World")
|
|
|
|
named_format1.format(name="Hello", world="World")
|
|
format(named_format2, name="Hello", world="World")
|
|
|
|
explicit_format1.format("Hello")
|
|
format(explicit_format2, "Hello")
|
|
|
|
implicit_format1.format("Hello")
|
|
format(implicit_format2, "Hello")
|
|
|
|
explicit_format1.format("Hello", "World", "Extra")
|
|
format(explicit_format2, "Hello", "World", "Extra")
|
|
|
|
implicit_format1.format("Hello", "World", "Extra")
|
|
format(implicit_format2, "Hello", "World", "Extra")
|
|
|
|
#OK ODASA-3197
|
|
if cond:
|
|
x_or_y = "{x}"
|
|
else:
|
|
x_or_y = "{y}"
|
|
|
|
format(x_or_y, x="x", y="y")
|
|
x_or_y.format(x="x", y="y")
|
|
|
|
#Still fail for multiple formats
|
|
format(x_or_y, x="x", y="y", z="z")
|
|
x_or_y.format(x="x", y="y", z="z")
|
|
|
|
#False positive reported by customer. -- Verify fix.
|
|
"<td class={}>{{}}></td>".format(html_class)
|
|
|
|
"{{0}}{0}".format("X")
|
|
"{{{}}}".format("X")
|
|
|
|
#Crash JDK regex engine -- unless possessive quantifiers are used.
|
|
(
|
|
"{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{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{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}"
|
|
)
|
|
|
|
#Make sure nested braces are handled properly:
|
|
"ANS_{}=${{{}}}".format(x, xID)
|
|
|
|
def foo(msg_width):
|
|
stdout.write(u'{}\r{}{:<{}}'.format(1, 2, 3, 4))
|
|
stdout.write(u'{}\r{}{:<{width}}'.format(1, 2, 3, width=msg_width))
|
|
|
|
#Check parsing with punctuation.
|
|
"invalid value of type {.__name__}: {}".format(int, 1)
|
|
|
|
def varying_format(cond):
|
|
fmt = "{}" if cond else "{}, {}"
|
|
return fmt.format("hello", "world")
|