Skip to content

Commit 9e916f1

Browse files
committed
add tests for constant
1 parent c41b647 commit 9e916f1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/functional/syntax/test_constants.py

+11
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,17 @@ def foo(): nonpayable
324324
FOO: constant(Foo) = Foo(BAR)
325325
BAR: constant(address) = 0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF
326326
""",
327+
# conversion of literal bytestrings to bytes_M
328+
"""
329+
b: constant(bytes5) = convert(b"vyper", bytes5)
330+
""",
331+
"""
332+
b: constant(bytes5) = convert("vyper", bytes5)
333+
""",
334+
"""
335+
a: constant(Bytes[5]) = b"vyper"
336+
b: constant(bytes5) = convert(a, bytes5)
337+
""",
327338
]
328339

329340

0 commit comments

Comments
 (0)