Skip to content

Commit c68965f

Browse files
Update run-strings.test
1 parent 6389f30 commit c68965f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

mypyc/test-data/run-strings.test

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,14 +412,16 @@ def test_basics() -> None:
412412
[case testFStrings]
413413
import decimal
414414
from datetime import datetime
415+
from typing import Final
415416

416417
var = 'mypyc'
417418
num = 20
419+
final_known_at_compile_time: Final = 'hello'
418420

419421
def final_value_setter() -> str:
420-
return 'hello'
422+
return 'goodbye'
421423

422-
final_var: Final = final_value_setter()
424+
final_unknown_at_compile_time: Final = final_value_setter()
423425

424426
def test_fstring_basics() -> None:
425427
assert f'Hello {var}, this is a test' == "Hello mypyc, this is a test"
@@ -456,7 +458,7 @@ def test_fstring_basics() -> None:
456458
inf_num = float('inf')
457459
assert f'{nan_num}, {inf_num}' == 'nan, inf'
458460

459-
assert f'{final_var}' == 'hello'
461+
assert f'{final_known_at_compile_time} {final_unknown_at_compile_time}' == 'hello goodbye'
460462

461463
# F-strings would be translated into ''.join[string literals, format method call, ...] in mypy AST.
462464
# Currently we are using a str.join specializer for f-string speed up. We might not cover all cases

0 commit comments

Comments
 (0)