Allow nil slice in hotels_test

This commit is contained in:
Daniil Riazanovskiy 2021-02-26 18:20:48 +00:00 committed by Arseny Balobanov
parent 28176c85a0
commit 69d2aa7212

View file

@ -59,7 +59,11 @@ func TestComputeLoad_basic(t *testing.T) {
},
} {
t.Run(tc.title, func(t *testing.T) {
require.Equal(t, tc.result, ComputeLoad(tc.guests))
if len(tc.result) == 0 {
require.Empty(t, ComputeLoad(tc.guests))
} else {
require.Equal(t, tc.result, ComputeLoad(tc.guests))
}
})
}
}