From 2f3a1e2fa48c39a190997fd60fce99ed1f9b7bca Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Mon, 12 Mar 2018 22:43:12 +0200 Subject: Add support for formatted strings --- tests/test_parse.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/test_parse.py') diff --git a/tests/test_parse.py b/tests/test_parse.py index aec69fe..cb0a354 100644 --- a/tests/test_parse.py +++ b/tests/test_parse.py @@ -40,6 +40,13 @@ class TestParse(object): vs = ViewState(raw=b'\xff\x01\n\x01\x02') assert vs.decode() == 'Color: unknown' # all colors are unknown for now + def test_formatted_string(self): + vs = ViewState() + s1 = 'System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' + s2 = '6111733106' + vs.raw = b'\xff\x01()' + bytes([len(s1)]) + s1.encode() + bytes([len(s2)]) + s2.encode() + assert vs.decode() == 'Formatted string: {} {}'.format(s2, s1) + def test_complex_pair(self): vs = ViewState() vs.raw = b'\xff\x01\x0f\x67\x0f\x68\x66' -- cgit v1.3.1