This commit is contained in:
J. Nick Koston
2025-12-06 22:55:28 -06:00
parent 81f4add324
commit f3a039e70f
+6
View File
@@ -248,6 +248,12 @@ class TestLiterals:
(cg.FloatLiteral(4.2), "4.2f"),
(cg.FloatLiteral(1.23456789), "1.23456789f"),
(cg.FloatLiteral(math.nan), "NAN"),
(cg.StringRefLiteral("foo"), 'StringRef::from_lit("foo")'),
(cg.StringRefLiteral(""), 'StringRef::from_lit("")'),
(
cg.StringRefLiteral('with "quotes"'),
'StringRef::from_lit("with \\042quotes\\042")',
),
),
)
def test_str__simple(self, target: cg.Literal, expected: str):