MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_string_literals

Method test_string_literals

Lib/test/test_grammar.py:179–217  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

177 check("[0xfor x in ()]")
178
179 def test_string_literals(self):
180 x = ''; y = ""; self.assertTrue(len(x) == 0 and x == y)
181 x = '\''; y = "'"; self.assertTrue(len(x) == 1 and x == y and ord(x) == 39)
182 x = '"'; y = "\""; self.assertTrue(len(x) == 1 and x == y and ord(x) == 34)
183 x = "doesn't \"shrink\" does it"
184 y = 'doesn\'t "shrink" does it'
185 self.assertTrue(len(x) == 24 and x == y)
186 x = "does \"shrink\" doesn't it"
187 y = 'does "shrink" doesn\'t it'
188 self.assertTrue(len(x) == 24 and x == y)
189 x = """
190The "quick"
191brown fox
192jumps over
193the 'lazy' dog.
194"""
195 y = '\nThe "quick"\nbrown fox\njumps over\nthe \'lazy\' dog.\n'
196 self.assertEqual(x, y)
197 y = '''
198The "quick"
199brown fox
200jumps over
201the 'lazy' dog.
202'''
203 self.assertEqual(x, y)
204 y = "\n\
205The \"quick\"\n\
206brown fox\n\
207jumps over\n\
208the 'lazy' dog.\n\
209"
210 self.assertEqual(x, y)
211 y = '\n\
212The \"quick\"\n\
213brown fox\n\
214jumps over\n\
215the \'lazy\' dog.\n\
216'
217 self.assertEqual(x, y)
218
219 def test_ellipsis(self):
220 x = ...

Callers

nothing calls this directly

Calls 4

lenFunction · 0.85
ordFunction · 0.85
assertTrueMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected