git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] t0028: fix test for UTF-16-LE-BOM

From
AGAlexandr Miloslavskiy via GitGitGadget <gitgitgadget@gmail.com>
Date
Sep 23, 2019, 08:33 UTC
Message-ID
<fe850a8cd597e48bf023f7a3b025fe497f9d6153.1569227601.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.347.git.gitgitgadget@gmail.com>
From: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>

According to its name, the test its designed for UTF-16-LE-BOM. However, possibly due to copy&paste oversight, it was using UTF-32 file.

While the test succeeds (probably interprets extra \x00\x00 as embedded zero), I myself had an unrelated problem which caused the test to fail. When analyzing the failure I was quite puzzled by the fact that the test is obviously bugged. And it seems that I'm not alone: https://public-inbox.org/git/CAH8yC8kSakS807d4jc_BtcUJOrcVT4No37AXSz=jePxhw-o9Dg@mail.gmail.com/T/#u

This fix changes the test to follow its original intention.
Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
---
 t/t0028-working-tree-encoding.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t0028-working-tree-encoding.sh b/t/t0028-working-tree-encoding.sh
index 1090e650ed..5493cf3ca9 100755
--- a/t/t0028-working-tree-encoding.sh
+++ b/t/t0028-working-tree-encoding.sh
@@ -40,7 +40,7 @@ test_expect_success 'setup test files' '
 	printf "$text" | write_utf16 >test.utf16.raw &&
 	printf "$text" | write_utf32 >test.utf32.raw &&
 	printf "\377\376"                         >test.utf16lebom.raw &&
-	printf "$text" | iconv -f UTF-8 -t UTF-32LE >>test.utf16lebom.raw &&
+	printf "$text" | iconv -f UTF-8 -t UTF-16LE >>test.utf16lebom.raw &&
 
 	# Line ending tests
 	printf "one\ntwo\nthree\n" >lf.utf8.raw &&
-- 
gitgitgadget
Previous: Alexandr Miloslavskiy via GitGitGadgetNext: Alexandr Miloslavskiy via GitGitGadget
Message 2 of 18 in “t0028 fix test + more tests”
  1. 0/2 t0028 fix test + more testsAlexandr Miloslavskiy via GitGitGadget, Sep 23, 2019
  2. 1/2 t0028: fix test for UTF-16-LE-BOMAlexandr Miloslavskiy via GitGitGadget, Sep 23, 2019
  3. 2/2 t0028: add more testsAlexandr Miloslavskiy via GitGitGadget, Sep 23, 2019
  4. 0/2 Update: fixed typos in commit messageAlexandr Miloslavskiy via GitGitGadget, Sep 23, 2019
  5. 1/2 t0028: fix test for UTF-16-LE-BOMAlexandr Miloslavskiy via GitGitGadget, Sep 23, 2019
  6. Torsten BögershausenSep 24, 2019
  7. Alexandr MiloslavskiySep 24, 2019
  8. 2/2 t0028: add more testsAlexandr Miloslavskiy via GitGitGadget, Sep 23, 2019
  9. Torsten BögershausenSep 24, 2019
  10. Alexandr MiloslavskiySep 24, 2019
  11. Johannes SixtSep 24, 2019
  12. Alexandr MiloslavskiySep 24, 2019
  13. 0/2 Update: fixed typos in commit messageAlexandr Miloslavskiy via GitGitGadget, Sep 24, 2019
  14. 2/2 t0028: add more testsAlexandr Miloslavskiy via GitGitGadget, Sep 24, 2019
  15. Junio C HamanoSep 28, 2019
  16. Alexandr MiloslavskiySep 30, 2019
  17. 1/2 t0028: fix test for UTF-16-LE-BOMAlexandr Miloslavskiy via GitGitGadget, Sep 24, 2019
  18. Torsten BögershausenSep 26, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.