🐐 Numbers as strings when needed
This commit is contained in:
3
tests.py
3
tests.py
@@ -611,6 +611,9 @@ string_concat_tests = [
|
||||
('NVLLVS : "hello"', Program([], [ExpressionStatement(BinOp(Nullus(), String("hello"), "SYMBOL_COLON"))]), ValStr("hello")),
|
||||
('"hello" : NVLLVS', Program([], [ExpressionStatement(BinOp(String("hello"), Nullus(), "SYMBOL_COLON"))]), ValStr("hello")),
|
||||
('NVLLVS : NVLLVS', Program([], [ExpressionStatement(BinOp(Nullus(), Nullus(), "SYMBOL_COLON"))]), ValStr("")),
|
||||
# integers coerce to Roman numerals in string context
|
||||
('"value: " : V', Program([], [ExpressionStatement(BinOp(String("value: "), Numeral("V"), "SYMBOL_COLON"))]), ValStr("value: V")),
|
||||
('X : " items"', Program([], [ExpressionStatement(BinOp(Numeral("X"), String(" items"), "SYMBOL_COLON"))]), ValStr("X items")),
|
||||
]
|
||||
|
||||
class TestStringConcat(unittest.TestCase):
|
||||
|
||||
Reference in New Issue
Block a user