예제 #1
0
 def test_expected_length_simple(self):
     self.assertEqual(
         6,
         day08.count_literals('"dpmxnj"\n')
     )
예제 #2
0
 def test_single_escaped_quote(self):
     self.assertEqual(
         7,
         day08.count_literals('"aaa\"aaa"\n')
     )
예제 #3
0
 def test_basic_hex_escape(self):
     self.assertEqual(
         1,
         day08.count_literals('"\x27"\n')
     )
예제 #4
0
 def test_extra_simple(self):
     self.assertEqual(
         3,
         day08.count_literals('"abc"\n')
     )
예제 #5
0
 def test_just_double_quotes(self):
     self.assertEqual(
         0,
         day08.count_literals('""\n')
     )
예제 #6
0
 def test_escaped_hex_notation(self):
     self.assertEqual(
         15,
         day08.count_literals('"aixfk\xc0iom\x21vueob"\n')
     )
예제 #7
0
 def test_escaped_backslash(self):
     self.assertEqual(
         12,
         day08.count_literals('"roc\\vra\\lhrm"\n')
     )
예제 #8
0
 def test_escaped_quotes(self):
     self.assertEqual(
         23,
         day08.count_literals('"twybw\"cdvf\"mjdajurokbce"\n')
     )