1
0
mirror of https://github.com/ManyakRus/starter.git synced 2025-11-26 23:10:42 +02:00

сделал IntNot0()

This commit is contained in:
Nikitin Aleksandr
2024-11-18 13:27:46 +03:00
parent ce9c53ba0d
commit 17dc9ee496
2 changed files with 34 additions and 0 deletions

View File

@@ -1228,3 +1228,23 @@ func TestSubstring(t *testing.T) {
}
}
}
func TestIntNot0(t *testing.T) {
// Testing when all input integers are 0
result1 := IntNot0(0, 0, 0)
if result1 != 0 {
t.Errorf("Expected 0, but got %d", result1)
}
// Testing when some input integers are 0 and some are non-zero
result2 := IntNot0(0, 5, 0, 10)
if result2 != 5 {
t.Errorf("Expected 5, but got %d", result2)
}
// Testing when all input integers are non-zero
result3 := IntNot0(3, 7, 2)
if result3 != 3 {
t.Errorf("Expected 3, but got %d", result3)
}
}