Пример #1
0
def test_day8b_result():
	total1 = sum([len(s) for s in strings])
	total2 = sum([len(escape_string(s)) for s in strings])

	assert_equals(total2, 42)
	assert_equals(total1, 23)
	assert_equals(total2 - total1, 19)
Пример #2
0
def test_escape_string():
	assert_equals(len(escape_string('""')), 6)
	assert_equals(len(escape_string('"abc"')), 9)
	assert_equals(len(escape_string('"aaa\\"aaa"')), 16)
	assert_equals(len(escape_string('"\\x27"')), 11)