Lines Matching refs:diff
1637 # Should we do a fancy diff?
1639 # Not unless they asked for a fancy diff.
1645 # If expected output uses ellipsis, a meaningful fancy diff is
1647 # a diff was a major help anyway, so this is commented out.
1649 # and could be the basis for a kick-ass diff in this case.
1658 # The other diff types need at least a few lines to be helpful.
1674 # Check if we should use diff.
1681 diff = difflib.unified_diff(want_lines, got_lines, n=2)
1682 diff = list(diff)[2:] # strip the diff header
1683 kind = 'unified diff with -expected +actual'
1685 diff = difflib.context_diff(want_lines, got_lines, n=2)
1686 diff = list(diff)[2:] # strip the diff header
1687 kind = 'context diff with expected followed by actual'
1690 diff = list(engine.compare(want_lines, got_lines))
1693 assert 0, 'Bad diff option'
1694 # Remove trailing whitespace on diff output.
1695 diff = [line.rstrip() + '\n' for line in diff]
1696 return 'Differences (%s):\n' % kind + _indent(''.join(diff))
1698 # If we're not using diff, then simply list the expected