def test_no_content(self): sm = sourcemap_util._identity_sourcemap('foo', '') self.assertEqual('foo', sm['file']) self.assertEqual('', sm['mappings'])
def test_no_filename(self): sm = sourcemap_util._identity_sourcemap(None, 'aaa\n\n') self.assertFalse('file' in sm, sm) self.assertEqual('A;A', sm['mappings'])
def test_num_lines_hanging_line(self): sm = sourcemap_util._identity_sourcemap('foo', 'aaa\nbbb') self.assertEqual('foo', sm['file']) self.assertEqual('AAAA;AACA', sm['mappings'])
def test_num_lines_many_newlines(self): sm = sourcemap_util._identity_sourcemap('foo', 'aaa\n\n') self.assertEqual('foo', sm['file']) self.assertEqual('AAAA;AACA', sm['mappings'])
def test_num_lines_one_line(self): sm = sourcemap_util._identity_sourcemap('foo', 'aaa\n') self.assertEqual('foo', sm['file']) self.assertEqual('AAAA', sm['mappings'])