git @ Cat's Eye Technologies Falderal / 834647c
It's the Text of the test; the Input is (will be) something else. Cat's Eye Technologies 11 years ago
1 changed file(s) with 6 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
185185 pass
186186
187187
188 class TestInput(Block):
188 class TestText(Block):
189189 pass
190190
191191
204204 ##### Documents #####
205205
206206 PREFIX = {
207 ' | ': TestInput,
207 ' | ': TestText,
208208 ' ? ': ExpectedError,
209209 ' = ': ExpectedResult,
210210 ' ->': Pragma,
246246 >>> d.append(' = Indented result')
247247 >>> d.parse_lines_to_blocks()
248248 >>> [b.__class__.__name__ for b in d.blocks]
249 ['InterveningMarkdown', 'Pragma', 'TestInput', 'ExpectedError',
250 'TestInput', 'ExpectedResult']
249 ['InterveningMarkdown', 'Pragma', 'TestText', 'ExpectedError',
250 'TestText', 'ExpectedResult']
251251 >>> [b.line_num for b in d.blocks]
252252 [1, 2, 3, 5, 6, 7]
253253
368368 if isinstance(block, ExpectedResult):
369369 expectation_class = OutputResult
370370 if expectation_class:
371 if isinstance(prev_block, TestInput):
371 if isinstance(prev_block, TestText):
372372 if current_functionality is None:
373373 raise FalderalSyntaxError(
374374 ("line %d: " % block.line_num) +
383383 ("line %d: " % block.line_num) +
384384 "expectation must be preceded by test input")
385385 else:
386 if isinstance(prev_block, TestInput):
386 if isinstance(prev_block, TestText):
387387 raise FalderalSyntaxError(
388388 ("line %d: " % block.line_num) +
389389 "test input must be followed by expectation")