205
from cStringIO import StringIO
206
return StringIO(t).readlines()
210
TZU = split_lines(""" The Nameless is the origin of Heaven and Earth;
211
The named is the mother of all things.
213
Therefore let there always be non-being,
214
so we may see their subtlety,
215
And let there always be being,
216
so we may see their outcome.
217
The two are the same,
218
But after they are produced,
219
they have different names.
220
They both may be called deep and profound.
221
Deeper and more profound,
222
The door of all subtleties!
225
LAO = split_lines(""" The Way that can be told of is not the eternal Way;
226
The name that can be named is not the eternal name.
227
The Nameless is the origin of Heaven and Earth;
228
The Named is the mother of all things.
229
Therefore let there always be non-being,
230
so we may see their subtlety,
231
And let there always be being,
232
so we may see their outcome.
233
The two are the same,
234
But after they are produced,
235
they have different names.
239
TAO = split_lines(""" The Way that can be told of is not the eternal Way;
240
The name that can be named is not the eternal name.
241
The Nameless is the origin of Heaven and Earth;
242
The named is the mother of all things.
244
Therefore let there always be non-being,
245
so we may see their subtlety,
246
And let there always be being,
247
so we may see their result.
248
The two are the same,
249
But after they are produced,
250
they have different names.
252
-- The Way of Lao-Tzu, tr. Wing-tsit Chan
256
MERGED_RESULT = split_lines(""" The Way that can be told of is not the eternal Way;
257
The name that can be named is not the eternal name.
258
The Nameless is the origin of Heaven and Earth;
259
The Named is the mother of all things.
260
Therefore let there always be non-being,
261
so we may see their subtlety,
262
And let there always be being,
263
so we may see their result.
264
The two are the same,
265
But after they are produced,
266
they have different names.
270
-- The Way of Lao-Tzu, tr. Wing-tsit Chan
277
class MergePoem(TestBase):
278
"""Test case from diff3 manual"""
280
m3 = Merge3(TZU, LAO, TAO)
281
ml = list(m3.merge_lines('LAO', 'TAO'))
282
self.log('merge result:')
283
self.log(''.join(ml))
284
self.assertEquals(ml, MERGED_RESULT)