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

сделал IsInt()

This commit is contained in:
Nikitin Aleksandr
2024-09-19 15:54:59 +03:00
parent c455e96e49
commit 5cca5bfde9
2 changed files with 37 additions and 0 deletions

View File

@@ -853,3 +853,23 @@ func TestStringFromMassInt64(t *testing.T) {
t.Errorf("Expected '%s', but got: %s", expectedResult, multipleResult)
}
}
func TestIsInt(t *testing.T) {
// Test with an empty string
emptyResult := IsInt("")
if emptyResult != false {
t.Errorf("Expected false for empty string, but got: %v", emptyResult)
}
// Test with a string containing only digits
digitResult := IsInt("12345")
if digitResult != true {
t.Errorf("Expected true for string containing only digits, but got: %v", digitResult)
}
// Test with a string containing non-digit characters
nonDigitResult := IsInt("abc123")
if nonDigitResult != false {
t.Errorf("Expected false for string containing non-digit characters, but got: %v", nonDigitResult)
}
}