{"thread":{"id":"37021","subject":"[PATCH 1/2] t0025: Rename the test files","startedAt":"2014-06-29T06:34:22Z","lastAt":"2014-06-29T06:34:22Z","messageCount":1,"participants":["Torsten Bögershausen"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"245148","messageId":"53AFB36E.7060008@web.de","threadId":"37021","inReplyTo":null,"subject":"[PATCH 1/2] t0025: Rename the test files","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2014-06-29T06:34:22Z","receivedAt":"2014-06-29T06:34:22Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"The current test files are named one, two and three.\nMake it clearer what the tests do and rename them into\nLFonly, CRLFonly and LFwithNUL.\n\nAfter the renaming we can see easier that we may want more test cases\nfor 2 types of files:\n- files which have mixed LF and CRLF line endings,\n- files which have mixed LF and CR line endings.\n\nSee commit fd6cce9e, \"Add per-repository eol normalization\" and\n\"the new safer autocrlf handling\" in convert.c\n\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\n t/t0025-crlf-auto.sh | 122 +++++++++++++++++++++++++--------------------------\n 1 file changed, 61 insertions(+), 61 deletions(-)\n\ndiff --git a/t/t0025-crlf-auto.sh b/t/t0025-crlf-auto.sh\nindex 28102de..c164b46 100755\n--- a/t/t0025-crlf-auto.sh\n+++ b/t/t0025-crlf-auto.sh\n@@ -12,144 +12,144 @@ test_expect_success setup '\n \n \tgit config core.autocrlf false &&\n \n-\tfor w in Hello world how are you; do echo $w; done >one &&\n-\tfor w in I am very very fine thank you; do echo ${w}Q; done | q_to_cr >two &&\n-\tfor w in Oh here is a QNUL byte how alarming; do echo ${w}; done | q_to_nul >three &&\n+\tfor w in Hello world how are you; do echo $w; done >LFonly &&\n+\tfor w in I am very very fine thank you; do echo ${w}Q; done | q_to_cr >CRLFonly &&\n+\tfor w in Oh here is a QNUL byte how alarming; do echo ${w}; done | q_to_nul >LFwithNUL &&\n \tgit add . &&\n \n \tgit commit -m initial &&\n \n-\tone=$(git rev-parse HEAD:one) &&\n-\ttwo=$(git rev-parse HEAD:two) &&\n-\tthree=$(git rev-parse HEAD:three) &&\n+\tLFonly=$(git rev-parse HEAD:LFonly) &&\n+\tCRLFonly=$(git rev-parse HEAD:CRLFonly) &&\n+\tLFwithNUL=$(git rev-parse HEAD:LFwithNUL) &&\n \n \techo happy.\n '\n \n test_expect_success 'default settings cause no changes' '\n \n-\trm -f .gitattributes tmp one two three &&\n+\trm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&\n \tgit read-tree --reset -u HEAD &&\n \n-\t! has_cr one &&\n-\thas_cr two &&\n-\tonediff=$(git diff one) &&\n-\ttwodiff=$(git diff two) &&\n-\tthreediff=$(git diff three) &&\n-\ttest -z \"$onediff\" && test -z \"$twodiff\" && test -z \"$threediff\"\n+\t! has_cr LFonly &&\n+\thas_cr CRLFonly &&\n+\tLFonlydiff=$(git diff LFonly) &&\n+\tCRLFonlydiff=$(git diff CRLFonly) &&\n+\tLFwithNULdiff=$(git diff LFwithNUL) &&\n+\ttest -z \"$LFonlydiff\" -a -z \"$CRLFonlydiff\" -a -z \"$LFwithNULdiff\"\n '\n \n test_expect_success 'crlf=true causes a CRLF file to be normalized' '\n \n \t# Backwards compatibility check\n-\trm -f .gitattributes tmp one two three &&\n-\techo \"two crlf\" > .gitattributes &&\n+\trm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&\n+\techo \"CRLFonly crlf\" > .gitattributes &&\n \tgit read-tree --reset -u HEAD &&\n \n \t# Note, \"normalized\" means that git will normalize it if added\n-\thas_cr two &&\n-\ttwodiff=$(git diff two) &&\n-\ttest -n \"$twodiff\"\n+\thas_cr CRLFonly &&\n+\tCRLFonlydiff=$(git diff CRLFonly) &&\n+\ttest -n \"$CRLFonlydiff\"\n '\n \n test_expect_success 'text=true causes a CRLF file to be normalized' '\n \n-\trm -f .gitattributes tmp one two three &&\n-\techo \"two text\" > .gitattributes &&\n+\trm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&\n+\techo \"CRLFonly text\" > .gitattributes &&\n \tgit read-tree --reset -u HEAD &&\n \n \t# Note, \"normalized\" means that git will normalize it if added\n-\thas_cr two &&\n-\ttwodiff=$(git diff two) &&\n-\ttest -n \"$twodiff\"\n+\thas_cr CRLFonly &&\n+\tCRLFonlydiff=$(git diff CRLFonly) &&\n+\ttest -n \"$CRLFonlydiff\"\n '\n \n test_expect_success 'eol=crlf gives a normalized file CRLFs with autocrlf=false' '\n \n-\trm -f .gitattributes tmp one two three &&\n+\trm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&\n \tgit config core.autocrlf false &&\n-\techo \"one eol=crlf\" > .gitattributes &&\n+\techo \"LFonly eol=crlf\" > .gitattributes &&\n \tgit read-tree --reset -u HEAD &&\n \n-\thas_cr one &&\n-\tonediff=$(git diff one) &&\n-\ttest -z \"$onediff\"\n+\thas_cr LFonly &&\n+\tLFonlydiff=$(git diff LFonly) &&\n+\ttest -z \"$LFonlydiff\"\n '\n \n test_expect_success 'eol=crlf gives a normalized file CRLFs with autocrlf=input' '\n \n-\trm -f .gitattributes tmp one two three &&\n+\trm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&\n \tgit config core.autocrlf input &&\n-\techo \"one eol=crlf\" > .gitattributes &&\n+\techo \"LFonly eol=crlf\" > .gitattributes &&\n \tgit read-tree --reset -u HEAD &&\n \n-\thas_cr one &&\n-\tonediff=$(git diff one) &&\n-\ttest -z \"$onediff\"\n+\thas_cr LFonly &&\n+\tLFonlydiff=$(git diff LFonly) &&\n+\ttest -z \"$LFonlydiff\"\n '\n \n test_expect_success 'eol=lf gives a normalized file LFs with autocrlf=true' '\n \n-\trm -f .gitattributes tmp one two three &&\n+\trm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&\n \tgit config core.autocrlf true &&\n-\techo \"one eol=lf\" > .gitattributes &&\n+\techo \"LFonly eol=lf\" > .gitattributes &&\n \tgit read-tree --reset -u HEAD &&\n \n-\t! has_cr one &&\n-\tonediff=$(git diff one) &&\n-\ttest -z \"$onediff\"\n+\t! has_cr LFonly &&\n+\tLFonlydiff=$(git diff LFonly) &&\n+\ttest -z \"$LFonlydiff\"\n '\n \n test_expect_success 'autocrlf=true does not normalize CRLF files' '\n \n-\trm -f .gitattributes tmp one two three &&\n+\trm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&\n \tgit config core.autocrlf true &&\n \tgit read-tree --reset -u HEAD &&\n \n-\thas_cr one &&\n-\thas_cr two &&\n-\tonediff=$(git diff one) &&\n-\ttwodiff=$(git diff two) &&\n-\tthreediff=$(git diff three) &&\n-\ttest -z \"$onediff\" && test -z \"$twodiff\" && test -z \"$threediff\"\n+\thas_cr LFonly &&\n+\thas_cr CRLFonly &&\n+\tLFonlydiff=$(git diff LFonly) &&\n+\tCRLFonlydiff=$(git diff CRLFonly) &&\n+\tLFwithNULdiff=$(git diff LFwithNUL) &&\n+\ttest -z \"$LFonlydiff\" -a -z \"$CRLFonlydiff\" -a -z \"$LFwithNULdiff\"\n '\n \n test_expect_success 'text=auto, autocrlf=true _does_ normalize CRLF files' '\n \n-\trm -f .gitattributes tmp one two three &&\n+\trm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&\n \tgit config core.autocrlf true &&\n \techo \"* text=auto\" > .gitattributes &&\n \tgit read-tree --reset -u HEAD &&\n \n-\thas_cr one &&\n-\thas_cr two &&\n-\tonediff=$(git diff one) &&\n-\ttwodiff=$(git diff two) &&\n-\tthreediff=$(git diff three) &&\n-\ttest -z \"$onediff\" && test -n \"$twodiff\" && test -z \"$threediff\"\n+\thas_cr LFonly &&\n+\thas_cr CRLFonly &&\n+\tLFonlydiff=$(git diff LFonly) &&\n+\tCRLFonlydiff=$(git diff CRLFonly) &&\n+\tLFwithNULdiff=$(git diff LFwithNUL) &&\n+\ttest -z \"$LFonlydiff\" -a -n \"$CRLFonlydiff\" -a -z \"$LFwithNULdiff\"\n '\n \n test_expect_success 'text=auto, autocrlf=true does not normalize binary files' '\n \n-\trm -f .gitattributes tmp one two three &&\n+\trm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&\n \tgit config core.autocrlf true &&\n \techo \"* text=auto\" > .gitattributes &&\n \tgit read-tree --reset -u HEAD &&\n \n-\t! has_cr three &&\n-\tthreediff=$(git diff three) &&\n-\ttest -z \"$threediff\"\n+\t! has_cr LFwithNUL &&\n+\tLFwithNULdiff=$(git diff LFwithNUL) &&\n+\ttest -z \"$LFwithNULdiff\"\n '\n \n test_expect_success 'eol=crlf _does_ normalize binary files' '\n \n-\trm -f .gitattributes tmp one two three &&\n-\techo \"three eol=crlf\" > .gitattributes &&\n+\trm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&\n+\techo \"LFwithNUL eol=crlf\" > .gitattributes &&\n \tgit read-tree --reset -u HEAD &&\n \n-\thas_cr three &&\n-\tthreediff=$(git diff three) &&\n-\ttest -z \"$threediff\"\n+\thas_cr LFwithNUL &&\n+\tLFwithNULdiff=$(git diff LFwithNUL) &&\n+\ttest -z \"$LFwithNULdiff\"\n '\n \n test_done\n-- \n2.0.0.9631.g7e872d2\n"}]}