Back to index

moin  1.9.0~rc2
Public Member Functions
test_diff_text.TestDiffText Class Reference

List of all members.

Public Member Functions

def testDiff

Detailed Description

Definition at line 11 of file test_diff_text.py.


Member Function Documentation

util.diff_text.diff: test correct diff calculation 

Definition at line 13 of file test_diff_text.py.

00013 
00014     def testDiff(self):
00015         """ util.diff_text.diff: test correct diff calculation """
00016         in1 = """AAA 001
00017 AAA 002
00018 AAA 003
00019 AAA 004
00020 AAA 005
00021 AAA 006
00022 AAA 007
00023 AAA 008
00024 AAA 009
00025 AAA 010
00026 AAA 011
00027 AAA 012
00028 AAA 013
00029 AAA 014
00030 """
00031 
00032         in2 = """AAA 001
00033 AAA 002
00034 AAA 005
00035 AAA 006
00036 AAA 007
00037 AAA 008
00038 BBB 001
00039 BBB 002
00040 AAA 009
00041 AAA 010
00042 BBB 003
00043 """
00044 
00045         result = diff_text.diff(in1.splitlines(), in2.splitlines())
00046         result = "\n".join(result)
00047 
00048         expected = """\
00049   AAA 001
00050   AAA 002
00051 - AAA 003
00052 - AAA 004
00053   AAA 005
00054   AAA 006
00055   AAA 007
00056   AAA 008
00057 + BBB 001
00058 + BBB 002
00059   AAA 009
00060   AAA 010
00061 + BBB 003
00062 - AAA 011
00063 - AAA 012
00064 - AAA 013
00065 - AAA 014"""
00066 
00067         assert result == expected, ('Expected "%(expected)s" but got "%(result)s"') % locals()
00068 


The documentation for this class was generated from the following file: