Lines Matching refs:expect
30 def check(self, result, expect): argument
31 self.assertEqual(result, expect,
33 self.show(expect), self.show(result)))
35 def check_wrap(self, text, width, expect, **kwargs): argument
37 self.check(result, expect)
39 def check_split(self, text, expect): argument
41 self.assertEqual(result, expect,
43 "but got %r" % (expect, result))
89 expect = ["This is a paragraph that already has line",
97 self.check(result, expect)
100 self.check(result, '\n'.join(expect))
103 expect = [" Test default tabsize."]
104 self.check_wrap(text, 80, expect)
107 expect = [" Test custom tabsize."]
108 self.check_wrap(text, 80, expect, tabsize=4)
117 expect = ["A short line. Note the single space."]
118 self.check(wrapper.wrap(text), expect)
124 expect = ["Well, Doctor? What do you think?"]
125 self.check(wrapper.wrap(text), expect)
128 self.check(wrapper.wrap(text), expect)
131 expect = ['I say, chaps! Anyone for "tennis?" Hmmph!']
132 self.check(wrapper.wrap(text), expect)
135 expect = ['I say, chaps!', 'Anyone for "tennis?"', 'Hmmph!']
136 self.check(wrapper.wrap(text), expect)
139 expect = ['And she said, "Go to',
142 self.check(wrapper.wrap(text), expect)
145 expect = ['And she said, "Go to hell!" Can you believe that?']
146 self.check(wrapper.wrap(text), expect)
149 expect = ['File stdio.h is nice.']
150 self.check(wrapper.wrap(text), expect)
188 expect = ("this-|is-|a-|useful-|feature-|for-|"
190 self.check_wrap(text, 1, expect, break_long_words=False)
191 self.check_split(text, expect)
230 expect = ["Em-dashes should be written --",
232 self.check_wrap(text, 30, expect)
233 self.check_wrap(text, 35, expect)
240 expect = ["You can also do",
243 self.check_wrap(text, 15, expect)
244 self.check_wrap(text, 16, expect)
245 expect = ["You can also do--",
248 self.check_wrap(text, 17, expect)
249 self.check_wrap(text, 19, expect)
250 expect = ["You can also do--this or even",
252 self.check_wrap(text, 29, expect)
253 self.check_wrap(text, 31, expect)
254 expect = ["You can also do--this or even---",
256 self.check_wrap(text, 32, expect)
257 self.check_wrap(text, 35, expect)
262 expect = ["Here's", " ", "an", " ", "--", " ", "em-", "dash", " ",
265 self.check_split(text, expect)
268 expect = ["and", " ", "then", "--", "bam!", "--",
270 self.check_split(text, expect)
287 expect = ["You should use the -n option, or",
289 self.check_wrap(text, 32, expect)
290 self.check_wrap(text, 34, expect)
291 self.check_wrap(text, 35, expect)
292 self.check_wrap(text, 38, expect)
293 expect = ["You should use the -n option, or --dry-",
295 self.check_wrap(text, 39, expect)
296 self.check_wrap(text, 41, expect)
297 expect = ["You should use the -n option, or --dry-run",
299 self.check_wrap(text, 42, expect)
303 expect = ["the", " ", "-n", " ", "option,", " ", "or", " ",
305 self.check_split(text, expect)
622 expect = ['Did you say',
628 self.check(result, expect)
632 self.check(result, expect)
655 expect = '''\
661 self.check(result, expect)
667 expect = [" This paragraph will be filled,",
671 self.check(result, expect)
673 expect = "\n".join(expect)
675 self.check(result, expect)
681 expect = '''\
689 self.check(result, expect)
720 expect = "Hello there.\nHow are ya?\nOh good."
721 self.assertEqual(expect, dedent(text))
725 expect = "Hello there.\n\nHow are ya?\nOh good.\n"
726 self.assertEqual(expect, dedent(text))
730 expect = "Hello there.\n\nHow are ya?\nOh good.\n"
731 self.assertEqual(expect, dedent(text))
740 expect = '''\
745 self.assertEqual(expect, dedent(text))
749 expect = "Foo\n Bar\n\n Baz\n"
750 self.assertEqual(expect, dedent(text))
754 expect = "Foo\n Bar\n\n Baz\n"
755 self.assertEqual(expect, dedent(text))
760 expect = " Foo\nBar\n"
761 self.assertEqual(expect, dedent(text))
765 expect = " Foo\n\nBar\n"
766 self.assertEqual(expect, dedent(text))
770 expect = " Foo\n\nBar\n"
771 self.assertEqual(expect, dedent(text))
776 expect = "hello\tthere\nhow are\tyou?"
777 self.assertEqual(expect, dedent(text))
781 self.assertEqual(expect, dedent(expect))
796 expect = "hello there\nhow are you?"
797 self.assertEqual(expect, dedent(text))
800 self.assertEqual(expect, dedent(text))
803 self.assertEqual(expect, dedent(text))
806 expect = "hello there\n how are you?"
807 self.assertEqual(expect, dedent(text))
811 expect = " \thello there\n \thow are you?\n\tI'm fine, thanks"
812 self.assertEqual(expect, dedent(text))
890 for text, expect in zip(self.CASES, expected):
891 self.assertEqual(indent(text, prefix), expect)
908 for text, expect in zip(self.CASES, expected):
909 self.assertEqual(indent(text, prefix, None), expect)
927 for text, expect in zip(self.CASES, expected):
928 self.assertEqual(indent(text, prefix, predicate), expect)
946 for text, expect in zip(self.CASES, expected):
947 self.assertEqual(indent(text, prefix, predicate), expect)
952 def check_shorten(self, text, width, expect, **kwargs): argument
954 self.check(result, expect)