mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user