{"thread":{"id":"37401","subject":"[PATCH v2 2/3] MinGW: Update tests to handle a native eol of crlf","startedAt":"2014-08-22T19:19:06Z","lastAt":"2014-08-22T19:19:06Z","messageCount":1,"participants":["Torsten Bögershausen"],"isPatch":true,"patchVersion":2,"patchTotal":3},"messages":[{"id":"248136","messageId":"53F797AA.1030504@web.de","threadId":"37401","inReplyTo":null,"subject":"[PATCH v2 2/3] MinGW: Update tests to handle a native eol of crlf","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2014-08-22T19:19:06Z","receivedAt":"2014-08-22T19:19:06Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"Some of the tests were written with the assumption that the native eol would\nalways be lf. After defining NATIVE_CRLF on MinGW, these tests began failing.\nThis change will update the tests to also handle a native eol of crlf.\n\nSigned-off-by: Brice Lambson <bricelam@live.com>\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\n t/t6038-merge-text-auto.sh | 54 +++++++++++++++++++++++++++++-----------------\n t/test-lib.sh              |  1 +\n 2 files changed, 35 insertions(+), 20 deletions(-)\n\ndiff --git a/t/t6038-merge-text-auto.sh b/t/t6038-merge-text-auto.sh\nindex d9c2d38..85c10b0 100755\n--- a/t/t6038-merge-text-auto.sh\n+++ b/t/t6038-merge-text-auto.sh\n@@ -72,6 +72,10 @@ test_expect_success 'Merge after setting text=auto' '\n \tsame line\n \tEOF\n \n+\tif test_have_prereq NATIVE_CRLF; then\n+\t\tappend_cr <expected >expected.temp &&\n+\t\tmv expected.temp expected\n+\tfi &&\n \tgit config merge.renormalize true &&\n \tgit rm -fr . &&\n \trm -f .gitattributes &&\n@@ -86,6 +90,10 @@ test_expect_success 'Merge addition of text=auto' '\n \tsame line\n \tEOF\n \n+\tif test_have_prereq NATIVE_CRLF; then\n+\t\tappend_cr <expected >expected.temp &&\n+\t\tmv expected.temp expected\n+\tfi &&\n \tgit config merge.renormalize true &&\n \tgit rm -fr . &&\n \trm -f .gitattributes &&\n@@ -95,16 +103,19 @@ test_expect_success 'Merge addition of text=auto' '\n '\n \n test_expect_success 'Detect CRLF/LF conflict after setting text=auto' '\n-\tq_to_cr <<-\\EOF >expected &&\n-\t<<<<<<<\n-\tfirst line\n-\tsame line\n-\t=======\n-\tfirst lineQ\n-\tsame lineQ\n-\t>>>>>>>\n-\tEOF\n-\n+\techo \"<<<<<<<\" >expected &&\n+\tif test_have_prereq NATIVE_CRLF; then\n+\t\techo first line | append_cr >>expected &&\n+\t\techo same line | append_cr >>expected &&\n+\t\techo ======= | append_cr >>expected\n+\telse\n+\t\techo first line >>expected &&\n+\t\techo same line >>expected &&\n+\t\techo ======= >>expected\n+\tfi &&\n+\techo first line | append_cr >>expected &&\n+\techo same line | append_cr >>expected &&\n+\techo \">>>>>>>\" >>expected &&\n \tgit config merge.renormalize false &&\n \trm -f .gitattributes &&\n \tgit reset --hard a &&\n@@ -114,16 +125,19 @@ test_expect_success 'Detect CRLF/LF conflict after setting text=auto' '\n '\n \n test_expect_success 'Detect LF/CRLF conflict from addition of text=auto' '\n-\tq_to_cr <<-\\EOF >expected &&\n-\t<<<<<<<\n-\tfirst lineQ\n-\tsame lineQ\n-\t=======\n-\tfirst line\n-\tsame line\n-\t>>>>>>>\n-\tEOF\n-\n+\techo \"<<<<<<<\" >expected &&\n+\techo first line | append_cr >>expected &&\n+\techo same line | append_cr >>expected &&\n+\tif test_have_prereq NATIVE_CRLF; then\n+\t\techo ======= | append_cr >>expected &&\n+\t\techo first line | append_cr >>expected &&\n+\t\techo same line | append_cr >>expected\n+\telse\n+\t\techo ======= >>expected &&\n+\t\techo first line >>expected &&\n+\t\techo same line >>expected\n+\tfi &&\n+\techo \">>>>>>>\" >>expected &&\n \tgit config merge.renormalize false &&\n \trm -f .gitattributes &&\n \tgit reset --hard b &&\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex b1bc65b..aceb418 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -871,6 +871,7 @@ case $(uname -s) in\n \t# exec does not inherit the PID\n \ttest_set_prereq MINGW\n \ttest_set_prereq NOT_CYGWIN\n+\ttest_set_prereq NATIVE_CRLF\n \ttest_set_prereq SED_STRIPS_CR\n \ttest_set_prereq GREP_STRIPS_CR\n \tGIT_TEST_CMP=mingw_test_cmp\n-- \n2.1.0.rc2.210.g636bceb\n"}]}