3 test_description='git p4 handling of UTF-16 files without BOM'
7 UTF16="\227\000\227\000"
9 test_expect_success 'start p4d' '
13 test_expect_success 'init depot with UTF-16 encoded file and artificially remove BOM' '
16 printf "$UTF16" >file1 &&
17 p4 add -t utf16 file1 &&
24 # P4D automatically adds a BOM. Remove it here to make the file invalid.
25 sed -e "\$d" depot/file1,v >depot/file1,v.new &&
26 mv depot/file1,v.new depot/file1,v &&
27 printf "@$UTF16@" >>depot/file1,v &&
32 test_expect_success 'clone depot with invalid UTF-16 file in verbose mode' '
33 git p4 clone --dest="$git" --verbose //depot &&
34 test_when_finished cleanup_git &&
37 printf "$UTF16" >expect &&
38 test_cmp_bin expect file1
42 test_expect_failure 'clone depot with invalid UTF-16 file in non-verbose mode' '
43 git p4 clone --dest="$git" //depot