test: Loop if content length is zero for Windows (#1151)

On Windows it seems the file can be created before the
content has been written, which results in comparing
an empty string.
This commit is contained in:
Kyle Carberry
2022-04-25 19:01:49 +00:00
committed by GitHub
parent 9056c53054
commit 64348882a0
+3
View File
@@ -175,6 +175,9 @@ func TestAgent(t *testing.T) {
if err != nil {
return false
}
if len(content) == 0 {
return false
}
if runtime.GOOS == "windows" {
// Windows uses UTF16! 🪟🪟🪟
content, _, err = transform.Bytes(unicode.UTF16(unicode.LittleEndian, unicode.UseBOM).NewDecoder(), content)